title: How to update a database value with an imagebutton in php
body: <p>I am working on an php file, winch shows an table with values of the database. every row has an imagebutton at the end, which should change the status, displayed with an image.
  so I think short function of it all must be, on click go to script go to php or jQuery?
  the buttons also have to give the id of the user to the next script or function, or os there a better way?</p>
  <p>here is my basic approach, with no functionality, for the moment</p>
  <p>in index.php</p>
  <pre><code>include(&quot;function.php&quot;);
  
  while ($row_user = mysql_fetch_assoc($result_user)) {
              
      $sqle = mysql_query(&quot;
                      SELECT COUNT(*) FROM 
                         places2user                                 
                      WHERE
                         user = '&quot;.mysql_real_escape_string($row_user['ID']).&quot;'
               
                      &quot;);
              $res23 = mysql_fetch_array($sqle);
  
  echo &lt;table&gt;
    echo &lt;tr&gt;
      echo &quot;&lt;td&gt;&quot;.$row_user['ID'].&quot; &lt;/td&gt;&lt;td&gt;&lt;input type=\&quot;image\&quot; src=\&quot;images/&quot;.htmlentities($row_user['receive'], ENT_QUOTES).&quot;\&quot; id=\&quot;status\&quot; name=\&quot;status\&quot; &gt;&lt;/td&gt;
    echo &lt;/tr&gt;
  echo &lt;/table&gt;
  }
  </code></pre>
  <p>there is also a function.php, with a changestatus($id) function, which updates the database values, but I think, this is not the right way to code this.</p>