Jump to content

Setting a new value to a record ?


proud

Recommended Posts

In my database i have got a field called (ID) of type integer and i have assigned it an (auto_increment) attribute...

 

My problem is that when i delete all the records from the table and add a new record thenafter, the (ID) of that new record continues to increment from the last deleted record,

so how can i set the (ID) of the new record to 1 in case all the previous records were deleted?

Link to comment
https://forums.phpfreaks.com/topic/64399-setting-a-new-value-to-a-record/
Share on other sites

This question is asked at least in two other threads and the counter question would always be 'why would u want to do that?'. The auto_increment feature is great for keeping the records unique and if u want them to behave as u want, hack mysql (lol) or dont use auto_increment but handle ids with code. In each way id say to stick to that feature and be glad with it.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.