Subscribe
Article Time Stamp: 02 June 2007, 05:03:17 GMT+7

MySQL Syntax Error And Solutions




I want to delete all record in my table with this code:
$list=mysql_query("select * from data",$myconnection);
while($delrow=mysql_fetch_row($list)){
mysql_query("delete from data");}

Those syntax has deleted all the records from table data, but not work with autoincremental field type. How can i delete the autoincremental field record ?



::Solutions::
You can use this code:
TRUNCATE `table_name`

Article Source: Monx Digital Library

Copyrighted@ Monx Digital Library, otherwise stated
Use of our service is protected by our Terms of Use



 Back To Previous Page ...  



Your Ad Here