asmith Posted January 27, 2008 Share Posted January 27, 2008 truncate table table_name i've used this code for more than 20 times . i table_name has an id field , that it is auto incement , not null and it is primary key . in this 20 times , sometimes it deleted all the rows and reset the id number , and started from 1 again . sometimes it deleted all the rows but didn't reset the id number ,so new records in that table continued the numbers from what it ws before truncate . what's wrong about ... me ? Link to comment https://forums.phpfreaks.com/topic/88037-truncate/ Share on other sites More sharing options...
budimir Posted January 27, 2008 Share Posted January 27, 2008 Can you post the whole code that you are using? Link to comment https://forums.phpfreaks.com/topic/88037-truncate/#findComment-450408 Share on other sites More sharing options...
asmith Posted January 27, 2008 Author Share Posted January 27, 2008 there's no code, i type that line in the mysql query browser . then i insert some line and see what happens to the id . Link to comment https://forums.phpfreaks.com/topic/88037-truncate/#findComment-450475 Share on other sites More sharing options...
fenway Posted January 27, 2008 Share Posted January 27, 2008 That's hard to believe. Link to comment https://forums.phpfreaks.com/topic/88037-truncate/#findComment-450498 Share on other sites More sharing options...
AndyB Posted January 27, 2008 Share Posted January 27, 2008 That's hard to believe. ... unless there are random typographical errors in what's entered or it's hosted on a flaky or seriously overloaded server. Link to comment https://forums.phpfreaks.com/topic/88037-truncate/#findComment-450500 Share on other sites More sharing options...
asmith Posted January 27, 2008 Author Share Posted January 27, 2008 lol anyway , anything i would add to truncate line to be sure id would start from 1 again ? Link to comment https://forums.phpfreaks.com/topic/88037-truncate/#findComment-450524 Share on other sites More sharing options...
fenway Posted January 27, 2008 Share Posted January 27, 2008 lol anyway , anything i would add to truncate line to be sure id would start from 1 again ? That's the definition of what truncate does. Link to comment https://forums.phpfreaks.com/topic/88037-truncate/#findComment-450699 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.