title: mysql_num_rows return 0 in the second query
body: <p>I have this code:</p>
  
  <pre><code>$sql    = "SELECT 
                 t.id AS txn_id, 
                 g.id AS guest_id, 
                 a.id AS booking_id 
             FROM 
                 bookings a
             LEFT JOIN transactions t ON a.txn_id=t.id
             LEFT JOIN guests g ON g.txn_id=t.id
             WHERE 
                 t.code='o2-i1321209942'
             LIMIT 1";
  
  $query  = mysql_query($sql);
  
  $exist  = mysql_num_rows($query);
  
  if(!$exist) {
       echo 'NOT EXISSSTTTT!!!!!!!!!!!!!!!!';
  } else {
       echo 'EXISSSTTTT!!!!!!!!!!!!!!!!';
  }
  </code></pre>
  
  <blockquote>
    <p>Note: data exists in the database</p>
  </blockquote>
  
  <p>When I click submit from a form it will display "NOT EXISSSTTTT!!!!!!!!!!!!!!!!" and then when I refresh the page or press Ctrl+F5 it will display "EXISSSTTTT!!!!!!!!!!!!!!!!" and when I refresh it again it will display "NOT EXISSSTTTT!!!!!!!!!!!!!!!!" again.</p>
  
  <p>It acts like:</p>
  
  <p>Submit: Not Exists</p>
  
  <p>Refresh: Exists</p>
  
  <p>2nd Refresh: Not Exists</p>
  
  <p>3rd Refresh: Exists</p>
  
  <p>Any suggestion why is it working weird? Any answer will be appreciated.</p>
  
  <p>Thanks.</p>