title: how to update database with onclick function
body: <p>how do i create a function with onclick?</p>
  
  <pre><code>&lt;?php if ($displayStatus['status'] == "Active") {?&gt;
      &lt;button class="selected"&gt;&lt;a href="#" onclick="return getSuccessOutput"&gt;Active&lt;/a&gt;&lt;/button&gt;&lt;br&gt;&lt;br&gt;
  &lt;?php } else {?&gt;
      &lt;button class="seedo"&gt;&lt;a href="#" onclick="return getSuccessOutput" &gt;Active&lt;/a&gt;&lt;/button&gt;&lt;br&gt;&lt;br&gt;
  &lt;?php } ?&gt;
  </code></pre>
  
  <p><a href="http://i.stack.imgur.com/RFJAp.png" rel="nofollow">image for status button</a></p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
      function getSuccessOutput() {
       //enter code here???
      }
  &lt;/script&gt;
  
  
  $HOST = "localhost";
  $USERNAME = 'root';
  $PASSWORD = '';
  $DB = 'DB';
  </code></pre>
  
  <p>the function is like if i would select the active button, upon clicking on the button, it will update the database and change the status in the DB "Status" row to Active. </p>