title: PHP MySql Query is showing old value after update
body: <p>I am updating a value in a sql table and then printing the value, it is still showing old value. </p>
  
  <pre><code>&lt;?
  print_r(mysql_fetch_array(mysql_query("select visits from Orders")));
  mysql_query("update Orders set visits=visits+1");
  print_r(mysql_fetch_array(mysql_query("select visits from Orders")));
  ?&gt;
  </code></pre>
  
  <p>It outputs 1 and then again 1. The second value should be 2. When I check in PhpMyAdmin it is 2 then why is it showing Old Value? </p>
  
  <p>Please help! Thanks in advance.</p>
  
  <p>Regards,
  Mike</p>
  
  <p><strong>Edit:</strong></p>
  
  <p>This is the code the OP tried:</p>
  
  <pre><code>mysql_connect("localhost","mayankx_tt","111111");
  mysql_select_db("mayankx_tt") or die(mysql_error()); 
  print_r(mysql_fetch_array(mysql_query("select visits from Orders")));
  mysql_query("update Orders set visits=visits+1");
  print_r(mysql_fetch_array(mysql_query("select visits from Orders"))); 
  </code></pre>
  
  <p>And his output:</p>
  
  <pre><code>Array ( [0] =&gt; 4 [visits] =&gt; 4 ) Array ( [0] =&gt; 4 [visits] =&gt; 4 )
  </code></pre>