I have a MYSQL database that looks like this:
id name orderID
19 James 0
20 Chrales 1
24 Michelle 2
...
I have a PHP code that deletes the record(s) from mysql database and it works fine.
This is the code for deleting:
if (isset($_GET['del'])) {
$del = $_GET['del'];
$sql = "DELETE FROM MYTABLE WHERE id='$del'";
$query = mysqli_query($db_conx, $sql);
printf("<script>location.href='index.php'</script>");
exit();
}
what i need to do is to reset the orderID
column everytime I delete a record from MYSQL database.
So, the orderID
is always, 0, 1, 2, 3, 4, 5 etc etc...
Could someone please avdice on this?
Any help would be appreciated.
EDIT:
The orderID is not an AUTO INCREMENT.