title: How to call sql command in php without submitting a form?
body: <p>I want to execute sql command such as</p>
  
  <pre><code>$query_run = mysql_query($query);
  </code></pre>
  
  <p>in php. But the only way I can find to trigger php event is to submit a form using:</p>
  
  <pre><code>if(isset$POST['submit']) {
      $query_run = mysql_query($query);
  }
  </code></pre>
  
  <p>But this would refresh the page and wipe off every thing that dynamically created on the page.</p>
  
  <p>What I want is to have a button, press which to trigger sql commands without reloading the page like <code>onclick</code> in js. However, sql command cannot be run inside js function (as I can find).</p>