php mysql_connect Óëmysql_pconnectº¯ÊýÓëʵÀý½Ì³Ì
php½Ì³Ì mysql½Ì³Ì_connect Óëmysql_pconnectº¯ÊýÓëʵÀý½Ì³Ì
mysql_connect
mysql_connect($this->root,$this->user,$this->pass)
/*
mysql_connect ,µ¥¸ö·´ÎÊÓû§²»»áƵ·±µÄµ÷ÓÃÊý¾Ý¿â½Ì³Ì£¬Ã»±ØÒª±£³ÖÁ¬½Ó£¬¶øÇÒmysqlµÄÁ¬½ÓÊýÒ²ÊÇÓÐÏÞÖƵģ¬ ʹÓà ¼°Ê±·ÃÎʱȽÏƵ·±£¬Ò²×îºÃʹÓÃmysql_connect£¬ÕâÑùʹÓõĹýµÄ×ÊÔ´¿ÉÒÔÁ¢¿ÌÊÍ·Å£¬·ñÔò£¬ÈÝÒ×Ôì³É×ÊÔ´ºÄ
*/
mysql_pconnect
/*
mysql_pconnect() º¯Êý´ò¿ªÒ»¸öµ½ MySQL ·þÎñÆ÷µÄ³Ö¾ÃÁ¬½Ó
*/
$con = mysql_pconnect("localhost","mysql_user","mysql_pwd");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
class testLinkMysql{
public $conn;
public $root='localhost';
public $user='root';//'loupan';
public $pass='root';//'loupandsffds';
public $db='dbname';
public $charset='gbk';
public $links='c'; //±êÌâ
function __construct() {
if( !$this->conn )
{
$this->connect();
}
}
function __destruct() {
if( $this->conn )
{
$this->close();
}
}
function MysqlConnect()
{
try{
if( 'p' == $this->links )
{
$this->conn = mysql_pconnect($this->root,$this->user,$this->pass) or die(mysql_error());
}
else
{
$this->conn = mysql_connect($this->root,$this->user,$this->pass) or die( mysql_error());
}
mysql_select_db($t
Ïà¹ØÎĵµ£º
MySQLÖеÄÁ÷³Ìº¯Êý
º¯Êý
¹¦ÄÜ
IF(value,t ,f)
Èç¹ûvalueΪÕ棬·µ»Øt£¬·ñÔò·µ»Øf
IFNULL(value1,value2)
Èç¹ûvalue1²»Îª¿Õ·µ»Øvalue1,·ñÔò·µ»Øvalue2
CASE WHEN [value1] THEN [result1] … ELSE [default] END
Èç¹ûvalue1ΪÕæ ·µ»Øresult2 ·ñÔò·µ»Ødefault
CASE [expr] WHEN [value1] THEN [result1] &helli ......
ÔÚÑ¡Ôñ´æ´¢ÒýÇæʱ£¬Ó¦¸ù¾ÝÓ¦ÓÃÌصãÑ¡ÔñºÏÊʵĴ洢ÒýÇ棬¶ÔÓÚ¸´ÔÓµÄÓ¦ÓÃϵͳ¿ÉÒÔ¸ù¾Ýʵ¼ÊÇé¿öÑ¡Ôñ¶àÖÖ´æ´¢ÒýÇæ½øÐÐ×éºÏ¡£
ÏÂÃæÊdz£Óô洢ÒýÇæµÄÊÊÓû·¾³¡£
¡ñMyISAM:ĬÈϵÄMysql²å¼þʽ´æ´¢ÒýÇæ¡£Èç¹ûÓ¦ÓÃÊÇÒÔ¶ÁдºÍ²åÈë²Ù×÷ΪÖ÷£¬Ö»ÓкÜÉÙ¸üкÍɾ³ý²Ù×÷£¬²¢ÇÒ¶ÔÊÂÎñÍêÕûÐÔ£¬²¢·¢ÐÔÒªÇó²»ÊǺܸߣ¬ÄÇÃ´Ñ ......
±àÒë°²×°
apache
ÏÂÔØapache°²×°
=============================
ÎÒ°ÑËû°²×°ÔÚ/usr/local/apacheĿ¼ÏÂ
tar -zxvf apacheÎļþ
½øÈë½âѹºóµÄĿ¼£¬ÅäÖÃ./configure --prefix=/usr/local/apache -enable-mods-shared=all -enable-so -enable-rewrite
make
make install
È»ºóÆô¶¯/usr/local/apache/bin/apachectl sta ......
ϵͳ¼°Èí¼þ°æ±¾
FreeBSD 7.3
Apache-2.2.14-5[ 1.3.42£¨Unix£©]
PHP-5.2.12
MySQL-5.0.90
Freebsdͨ¹ýport°²×°nginx
Nginx ("engine x") ÊÇÒ»¸ö¸ßÐÔÄÜµÄ HTTP ºÍ·´Ïò´úÀí·þÎñÆ÷£¬Ò²ÊÇÒ»¸ö IMAP/POP3/SMTP ´úÀí·þÎñÆ÷¡£ Nginx ÊÇÓÉ Igor Sysoev Ϊ¶íÂÞ˹·ÃÎÊÁ¿µÚ¶þµÄ Rambler.ru Õ¾µã¿ª·¢µÄ£¬ËüÒѾÔÚ¸ÃÕ¾µãÔËÐг¬¹ýÁ½ ......
<?php
class Model_Data_FocusData{
....
public function getData(){...}
}
class Model_Data_IndexData{
....
public function getData(){...}
}
?>
ÓÐÕâô¼¸¸öÀ࣬ϣÍûÄܹ»×Ô¶¯µÄ¸ù¾Ý²ÎÊýÀ´µ÷Óò»Í¬µÄÀà´¦ÀíÊý¾Ý¡£
¿´µ÷ÓÃÄ£¿é£º
<?php
function getData($act){
$class = "Mode ......