proud Posted August 11, 2007 Share Posted August 11, 2007 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? Quote Link to comment https://forums.phpfreaks.com/topic/64399-setting-a-new-value-to-a-record/ Share on other sites More sharing options...
Fadion Posted August 11, 2007 Share Posted August 11, 2007 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. Quote Link to comment https://forums.phpfreaks.com/topic/64399-setting-a-new-value-to-a-record/#findComment-321073 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.