how do people usually assign their IDs to primary keys in a table?
how do i reset the last_insert_id variable?
and let's say i have five rows in a table having auto_increment IDs ranging from 1 - 5. i deleted the row with ID = 4. now when i insert a new row, how do i get it to assign an ID = 4 instead of ID = 5? as in, how do i search through the column and determine and unused number so that i can use it? is there a built in function for that?
now i get it. say i have a table with 5 rows (ID 1 - 5). i deleted row 2. then i deleted row 4. i can put all the freed id numbers in another table. and when i wanna add a new row, it will look at the other table and see if any ids are available and use it. otherwise, it will pass a null and let auto_increment do it's thing.
so, you mean there is no way to change the value that is grabbed by last_insert_id()? where does last_insert_id() grab the information from? maybe if i know where it grabs the information from, i can change or reset it.