Creating a loop to update DB IDs
Posted: Fri Sep 22, 2006 8:28 am
I have a DB with a log file of all connections entering my website. From testing on this I have ran 'php <file>' from a console which has caused blank entries in the table and then genuine data has been added and I've now deleted these blank lines which has left a bad increment of the IDs eg - 1, 2, 3, 5, 6, 7.
What function is there in PHP to edit data on a certain row in the database and not where certain data is equal to something on any row. I want to go though:
A) Update row 1 ID with <variable>
B) Update row 2 ID with <variable + 1>
etc etc
I can do the looping I just don't know how to select certain rows.
Can someone point me in the right direction please.
Regards, Stephen
What function is there in PHP to edit data on a certain row in the database and not where certain data is equal to something on any row. I want to go though:
A) Update row 1 ID with <variable>
B) Update row 2 ID with <variable + 1>
etc etc
I can do the looping I just don't know how to select certain rows.
Can someone point me in the right direction please.
Regards, Stephen