php Êý¾Ý¿âµÄ·â×°Àà
<?php
class DB
{
private $link;
function connectDB($dbhost, $dbuser, $dbpw, $dbname="", $pconnect = 1)
{
if($pconnect)
{
if(!$this->link = mysql_pconnect($dbhost, $dbuser, $dbpw))
{
$this->mysqlErrorMessage('Can not connect to MySQL');
}
}
else
{
if(!$this->link = mysql_connect($dbhost, $dbuser, $dbpw))
{
$this->mysqlErrorMessage('Can not connect to MySQL');
}
}
if(!empty($dbname))
{
mysql_select_db($dbname,$this->link);
}
mysql_query("set names 'gb2312'",$this->link);
}
function selectDB($dbName)
{
mysql_select_db($dbName,$this->link);
}
function query($sql)
{
if(!($query = mysql_query($sql,$this->link)))
{
$this->mysqlErrorMessage('SQL Error',$sql);
}
return $query;
}
function mysqlErrorMessage($errorTitle,$errorContent)
{
echo $errorTitle." : ".$errorContent."<br>";
}
function fetchArray($query)
{
return mysql_fetch_array($query);
}
function fetchObject($query)
{
return mysql_fetch_object($query);
}
function closeDB()
{
mysql_clos
Ïà¹ØÎĵµ£º
ÎÞÒâ¼ä¿´µ½ÒÔǰ·¢µÄÌû×Ó.»ØÒäÆðÄÇЩPHPµÄÈÕÈÕÒ¹Ò¹
http://www.phpfans.net/ask/discuss2/343326196.html
<?
class gzg//¸ÆÖиÆÀà
{
var $x;//ÊôÐÔ
function gzg()//¹¹Ô캯Êý,ĬÈϲ»³Ô¸ÆÖиÆ
&n ......
Ò»¡¢°²×°ÏµÍ³»·¾³
1¡¢ÏµÍ³£ºcentos5
2¡¢²âÊÔÔÚvm5.5
×¼±¸Èí¼þ
lighttpd-1.4.18
ÏÂÔØµØÖ·
mysql-5.0.41
part1ÏÂÔØµØÖ·
part2ÏÂÔØµØÖ·
part3ÏÂÔØµØÖ·
php-5.2.3
ÏÂÔØµØÖ·
SupeSite/X-Space
part1ÏÂÔØµØÖ·
part2ÏÂÔØµØÖ·
part3ÏÂÔØµØÖ·
discuz
ÏÂÔØµØÖ·
¶þ¡¢´î½¨web·þÎñÆ÷°²×°¹ý³Ì
1¡¢mysql5°²×°
$ tar zx ......
°æÈ¨ÉùÃ÷£º¿ÉÒÔÈÎÒâ×ªÔØ£¬×ªÔØÊ±ÇëÎñ±ØÒÔ³¬Á´½ÓÐÎʽ±êÃ÷ÎÄÕÂÔʼ³ö´¦ºÍ×÷ÕßÐÅÏ¢¼°±¾ÉùÃ÷
http://www.5ilinux.com/lamp01.html
¹Ø¼ü×Ö£ºapache+mysql+php apache mysql php ÅäÖà lamp ·þÎñÆ÷ web
Linux+Apache+Mysql+PHPµäÐÍÅäÖÃ
µ÷ÊÔ»·¾³£ºRedhat9.0 Apache1.3.29 Mysql3.23.58 PHP4.3.4
LinuxϵͳµÄ°²×°ÎҾͲ»½²Á ......
1¡¢Êý×éµÄÉêÇëºÍʹÓãº
$array=array(array(2,324,34));
echo $array[0][1];
Ö±½ÓÉêÇëʹÓãº
$student[0][0]="ÎÒ";
$student[0][1]="ÊÇ";
$student[1][0]="Ë";
$student[1][1]="ά";
echo $student[1][0];
2¡¢±éÀú£º ......
Á¬½Ó£º
$conn=mysql_connect ("localhost:3306", "username", "password");
mysql_select_db("DBname");
¶Á£º
$exec="select * from stu";
$result=mysql_query($exec);
while($rs=mysql_fetch_object($result))
{
echo $rs->id." & ......