| Row Decrement I'm pretty new to using mySQL so please excuse my ineptitude.
I have created an SQL table using phpMyAdmin. I am successfully able to create and delete rows through php scripts. In my table, the first field is "id" which I set as auto_increment. Simply, I want this field to list a number for each row, incrementing for each additional row.
My problem is when I want to delete a row. Although I can delete a row successfully, I am now stuck with a disordered incrementation struction. For example, I have rows 1,2,3,4,and 5. I delete row 3. Now I have 1,2,4,5. I want to be able to decrement each row id after the one that is deleted so I'd end up with 1,2,3,4. Anyone know how I can do this? Thanks. |