database base erros

I created a query in my page that deletes a specific row in my database, by clicking on a radio button to select the row then a delete button to delete it finally. After deleting all the rows one after the other i cant seem to insert data to my database anymore and also when i manually insert data from my database i cant retrieve that data from my database anymore. As i inserted new row it continued to follow the last ID of the row i deleted instead beginning all over again line may be ID 1. Any help will do
This is my delete query:
[php] <?php
if (isset($_POST[‘del’])) {
$con = mysqli_connect (“localhost”, “rupert”, “” , “example”) or die (“Database connect error”);
mysqli_select_db($con, “example”) or die (“error connecting to database”);

  if (isset($_POST['ID'])){
   $query1 = "DELETE FROM validation where ID =" .$_POST['ID']." ";
   $result1 = mysqli_query($con,$query1); 
  }else {
	  mysqli_error();
        }
 }[/php]

That is exactly what an auto-increment id field is supposed to do. There is nothing wrong as far as the ID number going to the next number. Since you didnt post all the relevant code, no one is going to be able to help you.

Sponsor our Newsletter | Privacy Policy | Terms of Service