PHPÖÐmysql_fetch_array()ºÍmysql_fetch_row()µÄÇø±ð
×î½üÔÚ×öPHPÓëÊý¾Ý¿â½»»¥µÄproject£¬¼±ÓÚÇó³É£¬Ä£·ÂÁËÏÂÀý×ӾͿªÊ¼¶¯ÊÖ£¬½á¹ûÎó°Ñmysql_fetch_arrayд³ÉÁËmysql_fetch_row,囧ÊÂÀ´ÁË£¬·¢ÏÖ·µ»ØµÄÊý×é¾ÓÈ»ÊÇindex=>valueµÄÐÎʽ£¬¶øÃ÷Ã÷¼ÇµÃÊÇfield name=>valueµÄ¹þ£¬²éÊÖ²á²ÅÃ÷°×¡£
1. mysql_fetch_arrayµÄº¯ÊýÔÐÍÊÇ
array mysql_fetch_array ( resource $result [, int $result_type= MYSQL_BOTH ] )
Returns an array that corresponds to the fetched row and moves the internal data pointer ahead.
The type of returned array depends on how result_type is defined. By using MYSQL_BOTH (default), you'll get an array with both associative and number indices. Using MYSQL_ASSOC, you only get associative indices (as mysql_fetch_assoc() works), using MYSQL_NUM, you only get number indices (as mysql_fetch_row() works).
2. Õâ¾ÍºÜÃ÷°×ÁË£¬ÈôÉ趨²»Í¬µÄ²ÎÊý£¬mysql_fetch_array()¿ÉÒÔ×öµ½mysql_fetch_row()ºÍmysql_fetch_assoc()µÄ¹¦ÄÜ£¬¶øºóÁ½¸öº¯Êý¾ÍÖ»½ÓÊܵÚÒ»¸ö²ÎÊý£¬·µ»ØµÄ·Ö±ðÊÇassociative=>value, index=>valueµÄÊý×é
3.MYSQL_BOTHÊÇʲôЧ¹ûÄØ£¬²âÊÔÁËÏÂ
Sql: select firstname,lastname from table where id="c01";
$array=mysql_fetch_array($result,MYSQL_BOTH);
$array[0]ºÍ$array['firstname']Ò»Ñù
Ïà¹ØÎĵµ£º
°æȨÉùÃ÷£º¿ÉÒÔÈÎÒâתÔØ£¬×ªÔØʱÇëÎñ±ØÒÔ³¬Á´½ÓÐÎʽ±êÃ÷ÎÄÕÂÔʼ³ö´¦ºÍ×÷ÕßÐÅÏ¢¼°±¾ÉùÃ÷
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. -static 13%
--with-client-ldflags=-all-static
--with-mysqld-ldflags=-all-static
¾²Ì¬Á´½ÓÌá¸ß13%ÐÔÄÜ
2. -pgcc 1%
CFLAGS="-O3 -mpentiumpro -mstack-align-double" CXX=gcc \
CXXFLAGS="-O3 -mpentiumpro -mstack-alig ......
°²×°Ê±µÄÓÅ»¯
(ÒÔϲâÊÔÊý¾Ý¶¼À´×ÔÓÚmysqlµÄ¹Ù·½ÍøÕ¾)
²»ÒªÓÃrpm»òÆäËû¶þ½øÖÆ·½Ê½°²×°
ÒªÓÃÔ´´úÂë×Ô¼º±àÒë
Èç¹ûÊDZ¼ÌÚϵͳ£¬ÍƼöÓÃpgcc±àÒëÆ÷
ÇÒʹÓÃ-O6µÄ±àÒë²ÎÊý
ÕâÑù±à³öÀ´µÄmysql±ÈÓÃgcc2.95µÄÒª¿ì1%
½öÓÃÓõÃ×ŵÄ×Ö·û¼¯±àÒëMySql
mysqlÄ¿Ç°Ö§³Ö¶à´ï34ÖÖ²»Í¬µÄ×Ö·û¼¯(mysql4.1.11)
µ«ÎÒÃdz£ÓõÄÒ²Î޷ǾÍÊÇlati ......
<?
$_mysqlhost="localhost";
$_mysqluser="root";
$_mysqlpass="";
$_mysqldata="mydata";
$_connect=mysql_connect($_mysqlhost,$_mysqluser,$_mysqlpass) or die ("´íÎó".mysql_error());
mysql_query("SET character_set_connection=utf8, character_set_results=utf8, character_set_client=binary", $ ......