phpħÊõ·½·¨
class lamp
{
public function __construct()
{
}
public function __get($var) //»ñÈ¡²»´æÔÚµÄÊôÐÔʱµ÷ÓÃ
{
echo "²»´æÔÚ±äÁ¿$var<br>";
}
public function __set($var,$val) //ÉèÖò»´æÔÚµÄÊôÐÔµ÷ÓÃ
{
echo "²»´æÔÚµÄÊôÐÔ".$var."¸³ÖµÎª$val<br>";
}
public function __isset($var) //µ÷ÓÃissetº¯Êýʱµ÷ÓÃ
{
echo $var."ÊôÐÔ²»´æÔÚ<br>";
}
public function __unset($var) //µ÷ÓÃunsetº¯Êýʱµ÷ÓÃ
{
echo $var."ÊôÐÔ±»unset<br>";
}
public function __call($func,$param) //µ÷Óò»´æÔڵķ½·¨Ê±µ÷ÓÃ
{
echo $func."²»´æÔÚ";
print_r($param);
echo "<br>";
}
public function __sleep() //serialize¶ÔÏóÊǵ÷ÓÃ
{
echo "sleep...<br>";
return $this;
}
public function __wakeup() //unserialize¶ÔÏóʱµ÷ÓÃ
{
echo "wake up!<br>";
}
public function __clone() //¶ÔÏ󱻿Ë¡ʱµ÷ÓÃ
{
$this->sub=clone $this->sub;
}
public function __toString() //¶ÔÏó±»Êä³öʱµ÷ÓÃ
{
return strval($this->y); //±ØÐëΪstring
}
}
Ïà¹ØÎĵµ£º
Éý»ªÌṩÖÕÉíÃâ·ÑASP+access PHP+mysqlÐéÄâÖ÷»ú
Ò»£ºÉý»ªÍøÂç¿Æ¼¼ÓÐÏÞ¹«Ë¾,ÓëÉý»ªÍ¬ÔÚÕ¾³¤ÖÕÉíÃâ·Ñ¿Õ¼ä·ö³Ö¼Æ»®.
1¡¢×ð¾´µÄÓû§ÄúºÃ,Ò²ÐíÄú»¹ÔÚΪÿÄêÒ»½»µÄ¿Õ¼ä·ÑÓ÷¢³î,Ò²ÐíÄúÏë»ñµÃÒ»¸ö¸üÓÅÖʵĿռäÈ´²»ÏëͶÈëÌ«¶à,´ÓÏÖÔÚÆð ÕâЩÎÊÌ⽫ÓÈжø½â→Éý»ªÍøÂç←ÓëÉý»ªÍ¬ÔÚÕ¾³¤·ö³Ö¼Æ»®È«ÃæÆô¶¯¡£
2¡¢Ã»ÓÐ×¢²á¹«Ë¾ ......
Èí¼þÀë²»¿ªÊý¾Ý¿â£¬¶øPHP×î³£ÓõÄÊý¾Ý¿âÊÇMySQL¡£MySQLÊý¾Ý¿â·Ö·þÎñ¶ËºÍ¿Í»§¶Ë¡£
MySQL·þÎñ¶ËµÄ°²×°£º
(1)µã»÷MySQL°²×°°ü£¨´Ë´¦µÄ°²×°³ÌÐòΪmysql-5.0.18-win32.zip)
(2) ĬÈÏÊÇTypical,Èç¹ûÏëÐ޸ݲװ·¾¶µÄ»°Ò²¿ÉÒÔÑ¡Ôñcustom.
×¢Òâ:°²×°mysqlµÄ·¾¶ÖÐ,²»Äܺ¬ÓÐÖÐÎÄ!
(3)µã»÷intall¿ªÊ¼°²×°
(4)Ìø¹ý×¢²á
(5 ......
ÎÊÌ⣺
ÄãÏë´´½¨Ò»¸ö¶ÔÏ󣬲¢ÔÚÆäÖÐÌí¼ÓһЩÊôÐÔ£¬µ«ÊÇÄãÈ´²»Ïë°ÑËü×÷Ϊһ¸öÃ÷È·µÄÀàÕýʽµØ¶¨ÒåËü¡£ÕâÒ»µãÔÚһЩÇé¿öÏÂÊÇÏ൱ÓÐÓõģ¬ÀýÈçµ±ÄãÐèÒª¶¨ÒåÒ»¸ö·½·¨À´·µ»Ø´øÓÐijЩÊôÐÔ£¨²»È·¶¨µÄ£©µÄ¶ÔÏóʱ£¬¾ÍÈçͬ´Ómysql_fetch_object( ) »òÕß imap_header( )µÄʹÓÃÒ»Ñù¡£
һάÊý×é,ÎÒÏÖÔÚÌرðϲ»¶°ÑËüд³É¶ÔÏó,ÒòΪ¼üÅÌ´ ......
ÈçºÎ²»Ê¹ÓÃprepared statment£¬¶øÊÇÓùýÂ˵ķ½·¨±ÜÃâSQL×¢ÈëÄØ£¿
Ò»°ãÀ´Ëµmysql×Ô´øµÄ¹ýÂ˺¯ÊýÊDZȽϿɿ¿µÄ¡£mysql_real_escape_string()
µ«ÊÇÕâ¸öº¯ÊýÔÚijЩ×Ö·û¼¯ÖÐÓÐÎÊÌ⣬±ÈÈçGBK¡£Èç¹ûÄãÓÃUTF8ÄÇû¹Øϵ¡£
ÔÚPHPÀïÉèÖÃÊý¾Ý¿âµÄ×Ö·û¼¯²»Ó¦¸ÃÓãºmysql_query("SET NAMES UTF8");
¶øÓ¦¸ÃÓãºmysql_set_charset()
ÕâÑù ......
<?php
// Á¬½Ó£¬Ñ¡ÔñÊý¾Ý¿â
$dbconn = pg_connect("host=localhost dbname=publishing user=www password=foo")
or die('Could not connect: ' . pg_last_error());
// Ö´ÐÐ SQL ²éѯ
$query = 'SELECT * from authors';
$result = pg_query($query) or die('Query failed: ' . pg_last_error( ......