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µÄ·þÎñ¾³£·¢ÏÖ1067Õâ¸ö´íÎ󡣲鿴ʼþÈÕÖ¾ÒÔºó·¢ÏÖÏÂÃæµÄ´íÎóÐÅÏ¢
Unknown/unsupported table type: INNODB
ÈçºÎ½â¾ö£ºÔÚmysqlÊý¾Ý´æ·ÅĿ¼ÏÂÕÒµ½ ibdata ÒÔ¼°ib_logfile0¡¢ib_logfile1ɾµôÔÙÆô¶¯¾ÍºÃÁË ......
ת×Ôhttp://www.linuxbyte.org/yi-ge-mysql-server-shang-de-xiao-ji-qiao.html
ÔÚmy.cnf µÄ mysql ¶Ë Ìí¼ÓÈçÏÂÉèÖÃ
[mysql]
#no-auto-rehash # faster start of mysql but no tab completition
prompt="(\u:mysql1@linuxbyte.org \R:\m)[\d]: "
»á²úÉúÈçÏÂЧ¹û:
root@ubuntu:/home/hew# mysql -u hew -p
Enter pass ......
MySQLÓжàÖÖ´æ´¢ÒýÇ棺
MyISAM¡¢InnoDB¡¢MERGE¡¢MEMORY(HEAP)¡¢BDB(BerkeleyDB)¡¢EXAMPLE¡¢FEDERATED¡¢ARCHIVE¡¢CSV¡¢BLACKHOLE¡£
MySQLÖ§³ÖÊý¸ö´æ´¢ÒýÇæ×÷Ϊ¶Ô²»Í¬±íµÄÀàÐ͵Ĵ¦ÀíÆ÷¡£MySQL´æ´¢ÒýÇæ°üÀ¨´¦ÀíÊÂÎñ°²È«±íµÄÒýÇæºÍ´¦Àí·ÇÊÂÎñ°²È«±íµÄÒýÇ棺
¡ô MyISAM¹ÜÀí·ÇÊÂÎñ±í¡£ËüÌṩ¸ßËÙ´æ´¢ºÍ¼ìË÷£¬ÒÔ¼°È«ÎÄËÑË÷ÄÜÁ¦¡ ......
±àÒë°²×°
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 ......
<?php
class Model_Data_FocusData{
....
public function getData(){...}
}
class Model_Data_IndexData{
....
public function getData(){...}
}
?>
ÓÐÕâô¼¸¸öÀ࣬ϣÍûÄܹ»×Ô¶¯µÄ¸ù¾Ý²ÎÊýÀ´µ÷Óò»Í¬µÄÀà´¦ÀíÊý¾Ý¡£
¿´µ÷ÓÃÄ£¿é£º
<?php
function getData($act){
$class = "Mode ......