mysql×Ô¶¯Ôö³¤µÄÎÊÌâ,ÈçºÎ»Ö¸´´Ó1¿ªÊ¼
ÔÚÒ»¸ö±íÖÐÎÒÉèÖõ½autoidΪ×Ô¶¯Ôö³¤ÁÐ
ÀýÈçÓÐÈçÏÂÊý¾Ý
1 ÕÅÈý ÄÐ 20
2 ÍõÎå ÄÐ 22
3 ÀîËÄ ÄÐ 25
4 ³Â´ó ÄÐ 19
ÏÖÔÚÎÒ°Ñ autoid=3 ºÍ autoid=4 µÄÁ½Ìõ¼Ç¼ɾ³ý
È»ºóÎÒÔÙ²åÈëÒ»ÌõÊý¾Ý,ÀýÈç:
insert into userinfo(autoid,username,sex,age) values('null','´º¸ç','ÄÐ','27');
µ«ÊÇÃæÁÙÒ»¸öÎÊÌâ,±àºÅÊÇ´Ó5¿ªÊ¼ÁË,¶ø²»ÊǽÓ×Å´Ó3¿ªÊ¼.±Ï¾¹ÎÒ µÚÈýÌõºÍµÚËÄÌõ¼Ç¼ÒѾɾ³ýµÄÁË.
ÇëÎÊÈçºÎÈÃautoid ´Ó3¿ªÊ¼,Çë¸ßÊִͽÌ.
×Ô¶¯Ôö³¤ÁÐÉèÖóɲ»×Ô¶¯µÄ
»òÕßinsert into tb values £¨3£©£»
SQL code:
mysql> select auto_increment from information_schema.tables where table_name="te
st";
+----------------+
| auto_increment |
+----------------+
| 4 |
+----------------+
1 row in set (0.02 sec)
»òÕßÉèÖÃÕâ¸öÖµ
ÎÒÖ»ÄÜ˵,Â¥ÉÏÌ«¾´ÒµµÄ
ÎÒ²»¸øËû·Ö,ÎÒ¶Ô²»Æ𵳺ÍÈËÃñ.
¾¡Á¿²»ÒªÒ»»á×ÔÔö£¬Ò»»á¸øÓè±äÁ¿¡£
»áŪÂÒÊý¾Ý¿âµÄ¡£
Äþ¿É¶Ô´íÎóµÄÊý¾Ý½øÐÐupdateÐÞÕý£¬»òÕßdelete£¬¶ø²»ÒªinsertÒ»¸ö¸úÀÏÊý¾ÝÓÐÏàͬIDµÄÐÂÊý¾Ý¡£
Ïà¹ØÎÊ´ð£º
±àÒëÆ÷£ºC-Free4
mysql µ¥¶À°²×°µÄ£¬ÏÖÔÚΪapache+php+mysql¿ÉÒÔʹÓá£
×î½üÔÚÁ·Ï°c£¬c++£»ÏëÓÃc£¬c++Á¬½ÓÏÂÎÒµÄmysql£¬ºÃ¶àµØ·½¶à˵mysql.hÕÒ²»µ½¡£¶øÇÒÎÒmysqlûÓÐËùνµÄincludeÎļþ¼Ð°¡¡£
Íü¸ßÊÖÖ¸µãÒ»¶ ......
ÎÒ֮ǰµ¼ÈëµÄÊý¾Ý¿â£¬ÏÖÔÚɾ³ý²»ÁË£¬ÓÃÁËÃüÁîÐк͹¤¾ß¶¼²»ÐУ¬ÖØÆôÒ²²»ÐУ¬ÕâÊÇΪʲôÄØ£¿
ÄãÊÇÈçºÎɾ³ýµÄ£¿
ÓÐʲôÌáʾ£¿
ÎÊÌâ˵Ã÷Ô½Ïêϸ£¬»Ø´ðÒ²»áԽ׼ȷ£¡²Î¼ûÈçºÎÌáÎÊ¡££¨ÌáÎʵÄÖǻۣ©
......
ÎÒÔÚ×¢²áÒ³ÃæдÈëÁËÈçÏ´úÂ룺
<?php
$conn=mysql_connect("localhost","root","614510")or die("Êý¾Ý¿â·þÎñÆ÷Á¬½Ó´íÎó".mysql_error());
& ......
MySqlÖвåÈ뵱ǰʱ¼äµÄ¸ÃÔõôд°¡£¿
now()
SQL code:
sqlÀïÊÇ£º
getdate()
ÒýÓÃ
now()
ѧϰ
SQL code:
select now();
SQL code:
TODAY()
?
SQL code:
select now();
/* ......
linuxϵͳ ÔÀ´×Ô´ømysqlÒѾжÔØ ÐÂװа汾 °²×°Ê±Ìáʾ unpacking of archive failed on file usr/bin/ replace 4acebledle4d:cpio :read ÇëÎÊÊÇʲôÎÊÌâ
ÒýÓÃ
ÎļþÊÇÖ»¶ÁµÄ ¸ü¸ÄϸÃĿ¼ȨÏÞΪ ......