title: DELETE ROW command is getting skipped without any ERROR
body: <p>I have two tables, table1 has multiple rows with data, while table2 is empty.</p>
  
  <p>I m trying to perform a simple INSET into and DELETE command in php to add the selected row from table1 to table2 and at the same time DELETE the selected row from table1</p>
  
  <p>But here, it gets inserted to table 2 and doesn't get deleted from table 1 but returns to main page without any error.</p>
  
  <p>My code as follows:</p>
  
  <p>Calling row content from table1 to user page:</p>
  
  <pre><code>&lt;?php 
  $sql2 = "SELECT * FROM apromocode ";
  $result2 = $conn-&gt;query($sql2);
  if ($result2-&gt;num_rows &gt; 0) {                               
      while($row2 = $result2-&gt;fetch_assoc()) {
      ?&gt;          
          &lt;tr &gt;
              &lt;form id="promocodesub" action="apromocodesubdelete.php" method="post"&gt;
                  &lt;td&gt;
                      &lt;?php echo ($row2["id"]); ?&gt;
                  &lt;/td&gt;
                  &lt;td&gt;
                      &lt;?php echo ($row2["code"]); ?&gt;
                  &lt;/td&gt;
                  &lt;input type="hidden" form="promocodesub" name="code" value="&lt;?php echo ($row2["code"]); ?&gt;"/&gt;
                  &lt;td&gt;
                      &lt;?php echo ($row2["occation"]); ?&gt;
                  &lt;/td&gt;
                  &lt;input type="hidden" form="promocodesub" name="occation" value="&lt;?php echo ($row2["occation"]); ?&gt;"/&gt;
                  &lt;td&gt;
                      &lt;?php echo ($row2["about"]); ?&gt;
                  &lt;/td&gt;
                  &lt;input type="hidden" form="promocodesub" name="about" value="&lt;?php echo ($row2["about"]); ?&gt;"/&gt;
                  &lt;td&gt;
                      &lt;?php echo ($row2["discount"]); ?&gt;
                  &lt;/td&gt;
                  &lt;input type="hidden" form="promocodesub" name="discount" value="&lt;?php echo ($row2["discount"]); ?&gt;"/&gt;
                  &lt;td&gt;
                      &lt;?php echo ($row2["date"]); ?&gt;
                  &lt;/td&gt;
                  &lt;td&gt;
                      &lt;button form="promocodesub" type="submit" name="deleteId" value="&lt;?php echo ($row2["id"])?&gt;"class="promocodedelete"&gt;Delete&lt;/button&gt;
                  &lt;/td&gt;
              &lt;/form&gt;
          &lt;/tr&gt;  
      &lt;?php
      }
  } else {
      echo "0 results";
  }
  ?&gt;
  </code></pre>
  
  <p>So, when user open the page, he will see all row contents lined up in sequence along with "delete" button for each. When the user presses the delete button for that particular row, it will get inserted to table2 and should get deleted from the table1 with the following script:</p>
  
  <pre><code>&lt;?php include('amerchantassign.php'); ?&gt;
  &lt;?php
  $servername  = "localhost";
  $dbusername = "root";
  $dbpassword = "";
  $dbname = "";
  $code = $_POST['code'];
  $occation = $_POST['occation'];
  $about = $_POST['about'];
  $discount = $_POST['discount'];
  $date = date_default_timezone_set('Asia/Kolkata');
  $date = date('M-d,Y H:i:s');
  enter code here
  
  $conn = new mysqli ($servername, $dbusername, $dbpassword, $dbname);
  if ($conn-&gt;connect_error) {
      die("Connection failed: " . $conn-&gt;connect_error);
  }
  
  $deleteId= $_POST['deleteId'];
  
  $sql="INSERT INTO apromocodehistory (code, occation, about, discount, date)
  SELECT code, occation, about, discount, date
  FROM   apromocode 
  WHERE  id=  $deleteId";
  
  if ($conn-&gt;query($sql) === TRUE) {
      $sql4 = "DELETE FROM feedback WHERE id = '$deleteId' ";
  
      if ($conn-&gt;query($sql4) === TRUE) {
          echo '&lt;a href="amerchantassign.php"&gt;&lt;/a&gt;';
      } else {
          echo "ERROR" . $sql4;
      }
  } else {
      echo "ERROR" . $sql . "&lt;br&gt;" . $conn-&gt;error;
  }
  $conn-&gt;close();
  ?&gt;
  </code></pre>
  
  <p>Any Suggestions are appreciated...</p>