vegnadragon Posted March 5, 2008 Share Posted March 5, 2008 OK, what i want to do is insert some tables to my database, however the purpose of the database is to keep creating and deleting some information, i'll set a ID for a key and auto_increment, but how can i restart and tell mysql to restart back from one once it has reached its limit? Quote Link to comment Share on other sites More sharing options...
fenway Posted March 5, 2008 Share Posted March 5, 2008 TRUNCATE TABLE if you really want to delete everything; otherwise, don't. Quote Link to comment Share on other sites More sharing options...
aschk Posted March 5, 2008 Share Posted March 5, 2008 What is this "limit" you're planning on imposing on it? Date, number of rows, some other constraint? Part of the appeal of databases is the ability to record information over time, and hence track how records change, or differ when new ones are added. Why would you want to delete information? Quote Link to comment Share on other sites More sharing options...
vegnadragon Posted March 6, 2008 Author Share Posted March 6, 2008 Let's say i have a table with a ID (which contain primary key and auto_increment) and the column is set to have a int of 1 space for example. So the last value would be 9, so after 9 i wanted to return to id 1 and keep going until it reached 9 again, i never went over the value limit so i don't know what happens. Quote Link to comment Share on other sites More sharing options...
fenway Posted March 6, 2008 Share Posted March 6, 2008 The last value wouldn't be 9... whatever. Why do you want to do this? Quote Link to comment Share on other sites More sharing options...
vegnadragon Posted March 6, 2008 Author Share Posted March 6, 2008 i am making a mini web game, and it is heavily influenced by time, i want to have a set amount of slots to implement some values that i can access once the time is gone. I also want to delete the values once the time is reached and insert another value. Quote Link to comment Share on other sites More sharing options...
kenchucky Posted March 6, 2008 Share Posted March 6, 2008 Is there any reason that TRUNCATE TABLE will not work for you? Quote Link to comment Share on other sites More sharing options...
fenway Posted March 6, 2008 Share Posted March 6, 2008 i am making a mini web game, and it is heavily influenced by time, i want to have a set amount of slots to implement some values that i can access once the time is gone. I also want to delete the values once the time is reached and insert another value. You can deal with time-based constraints differently.... Quote Link to comment 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.