ÓÃPHPÅÅÐòmysqlÎÊÌâ
²»ÖªµÀÊDz»ÊÇÎÒµÄxamppÓÐÎÊÌ⣬mysqlÊÇͼÐλ¯µÄ£¡
Ò»¸öID×éÔÚÎÒµÄmysqlµÄ±íÀïÃæ 2£¬5£¬8£¬7
µãÁËÅÅÐò£¬È»ºóÓÃPHPÎļþÁ¬½ÓÕâ¸ö±íÏÔʾ±íµÄÐÅϢʱ£¬IDµÄ˳Ðò»¹ÊDz»±ä£¡Ó¦¸ÃÊÇ2£¬5£¬7£¬8µÄ°ÉÉýÐòÅÅÐòºó£¡
ÔÚPHPÎļþÀïÓÃPHP code:
$sql="SELECT * from retabs ORDER BY num asc";
$results=mysql_query($sql)
or die("ÅÅÐòʧ°Ü".mysql_error);
Ò²²»ÐУ¡ÓôÃÆËÀÁË£¡Ò²²»ÌáʾÅÅÐòʧ°Ü£¡
ÇëÎÊÕâ¸öÊÇÔõô»ØÊ°¡£¿
лл´ó¼ÒÁË
PHP code:
ÄãÒª°´IDÅÅÐòÓ¦¸ÃÊÇ£º
select * from retabs order by id;
¶î »Ø¶þÂ¥µÄ£¡ÎÒÄÇÅÅID×éËù¶ÔÓ¦µÄÃû×ÖÊÇnum£¬ºÇºÇ£¡
ÎÒµÄÓ﷨û´íµÄ
˰ﶥϰ¡ ллÁË
Äã°Ñ´íÎóÐÅÏ¢´òÓ¡³öÀ´¿´¿´
SQL code:
$sql="SELECT * from `retabs` ORDER BY `num` ASC";
¿´ÄãµÄÓï¾ä£¬Ó¦¸ÃûÓдíµÄ
ÄÇÄã°ÑID×éÉèÖóÉ×ÔÔöÀàÐÍ
SQL code:
alter table retable change num int auto_increment primary key
ÄãÓ¦¸Ã³¢ÊÔʹÓÃmysqlµÄÃüÁîÐÐÖвâÊÔÄãµÄsqlÓï¾äÓÐûÓÐÎÊÌâ¡£
Èç¹ûûÓÐÄã¾ÍÓ¦¸ÃÈ¥ÏëÏëÆäËûµØ·½µÄÎÊÌâ¡£
ÅÅÐòµ
Ïà¹ØÎÊ´ð£º
ÎÒÔÚphpÒ»¸ö½çÃæË¢ÐÂÒÔºóÏëÔÚ1·ÖÖÓÒÔºó½øÐвÙ×÷£¨±ÈÈç˵µ¯³ö¸öÌáʾ¿ò£©
¸ßÊÖÖ¸µãÈçºÎ²Ù×÷
ÊÇÓÃsessionµÄÉú´æÊ±¼äÉèÖÃÂ𣿻¹ÊDZðµÄʲô·½·¨
Çë˵Ïêϸµã¡£¹òÇó¡£
ʲôÒâ˼£¿Ò»·ÖÖӺ󵯳öÌáʾÌáʾ¿ò£¿ÄÇÓÃjavascrip ......
ÀýÈçÒ»¾äÎı¾ AAA'BBB\CCC
ÓÃÁË mysql_real_escape_string ºó ¿ÉÒÔ´æ½øÊý¾Ý¿â
µ«¶Á³öÀ´µÄʱºò£¬¾Í³ÉÁË
AAA\'BBB\\\CCC
ÈçºÎ»¹ÔΪ AAA'BBB\CCC
addslashes
stripslashes
[b][/b]ÒýÓÃ
adds ......
ÎÒÓÐÒ»¸öjava»·¾³ÏµijÌÐò£¬ÔÚ±¾»úÔËÐÐÕý³££¬µ«·¢²¼µ½ÍøµÄÐéÄâÖ÷»úʱ²»ÄÜÁ¬½ÓÊý¾Ý¿âÁ¬½Ó³Ø
jdk 1.6 tomcat6.0.18 mysql5 mysqljdbc5.1.5
ÐéÄâÖ÷»úµÄ¼¼ÊõÈËԱ˵£¬Ö»ÄÜÅäÖþÖÓòµÄÊý¾Ý¿âÁ¬½Ó³Ø£¬Ò²¾ÍÊÇÔÚM ......
ÈçÌâ Êý¾ÝÊÇBLOBÀàÐÍ Ôõô²ÅÄÜÐÞ¸ÄÆäÖеÄijЩֵ
BLOBÖдæÈëµÄÊÇʲôÄÚÈÝ£¿
¼ÙÉè×Ö¶ÎmemoΪblobÀàÐÍ£¬ÔÚ¸Ã×ֶεÄÖµÇ°ÃæÔö¼Ó×Ö·û´®'add--'
Ôò²Ù×÷Óï¾äÈçÏ£º
SQL code:
update tb_blog set memo=concat( ......
ÔÚÈýÊ®½²Óöµ½ÕâÑùÒ»¸öÎÊÌâ¾ÍÊÇÔËÐдúÂëʱ³öÏÖ´íÎó Fatal error: Call to undefined method mysql::fetch_array() in D:\WWW\news\index.php on line 12
£¬ÎÒ°Ñmysql::fetch_array() ¸Ä³Émysql::fetch_row() ÓÖ³öÏÖF ......