Second prepared statement is not firing <p>thanks for your time.</p> <p>Below I have two prepared statements, query &amp; query2;</p> <p>con is the connection var</p> <p>The first query is running perfectly and updating the database.</p> <p>The second query is not updating anything, although it is not giving any error.</p> <p>When I look at the second query that is logged after a "successful" run, the inserted variable is looking like an empty string. i.e. <code>RESTI</code>=''</p> <p>Why is this happening? Is my code in the right order for the second query to run?</p> <pre><code>$row = 1; $con=mysqli_connect("connect info"); if (mysqli_connect_errno()) { //echo "Failed to connect to MySQL Error 1: " . mysqli_connect_error(); //error reporting done here } else { $con-&gt;autocommit(false); $query = $con-&gt;prepare("UPDATE table where `INDEX`=?"); $query2 = $con-&gt;prepare("UPDATE table2 where (SELECT column from table where`RESTI`=?)"); $query-&gt;bind_param('i', $row); $query2-&gt;bind_param('i', $row); if($query-&gt;execute() == false) { //Failed! /ERROR HANDLING } else { //SUCCESS } if($query2-&gt;execute() == false) { //Failed! /ERROR HANDLING } else { //Success } $con-&gt;commit(); $query-&gt;close(); $query-&gt;close(); } mysqli_close($con); </code></pre>