title: Update query showing old data after submitting
body: <p>I have the following code:</p>
  
  <pre><code>$sql = mysql_query("UPDATE users SET name='$name' WHERE email='$email'") or die(mysql_error());
  echo "&lt;h4&gt;Your information has been updated&lt;/h4&gt;&lt;br /&gt;";
  </code></pre>
  
  <pre class="lang-html prettyprint-override"><code>&lt;form method="post" action="&lt;?php echo $_SERVER['PHP_SELF']; ?&gt;"&gt;
      &lt;p&gt;
          &lt;label for='name'&gt;Name&lt;/label&gt;&lt;br /&gt;&lt;br /&gt;
          &lt;input class="input-text required" name="name" type="text" value="&lt;?php echo $row[name]; ?&gt;" /&gt;
      &lt;/p&gt;
      &lt;p&gt;&lt;input type="submit" name="update" value="Update" /&gt;&lt;/p&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>After clicking Update, it updates the information in the database, but the <code>&lt;?php echo $row['name']; ?&gt;</code> still shows the old value. Only after refreshing the page does it show the updated information. I could have it refresh the page after updating by echoing meta refresh but I want it to still show the echo saying "Your info has been updated" which doesn't happen if I set it to refresh. Is there any solution?</p>