title: Echoing a <div> and obtaining the id of it
body: <p>Currently, when displaying all posts made by users I do the following:</p>
  
  <pre><code>while($info=mysql_fetch_array($data)) {
  echo "&lt;div id = 'posts'&gt;";
     echo $info['subject'];
     echo $info['post-item'];
  echo "&lt;/div&gt;";
  
  }
  </code></pre>
  
  <p>But, however, I now need to treat each element fetched as an actual post rather than just an outputted <code>div</code> for obtaining the post_id of each post to be able to actually enable a user to interact with different posts e.g. to 'like' a post.</p>
  
  <p>I had tried hyperlinking the like <code> href</code> to <code>?id=$thispost</code> which worked for liking however had problems such as a user altering the url, or even if I would like to also add the commenting functionality, I would need a different method!</p>