Showing delete link for comments posted by the logged in users only in PHP
<p>I have a page which shows the comments posted by all users. Here I need to show a delete link on the side of the comments posted by that current logged in user and he should be able to delete that comment too (like in Facebook, Orkut or any Blogging site). The sample code which I have tried is:</p>

<pre><code>&lt;?php
$user_id = 1;
$con = mysql_connect("localhost","root","root");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }

mysql_select_db("blog", $con);

$result = mysql_query("SELECT * FROM replies");

while($row = mysql_fetch_array($result))
  {
  $replies = $row;
  if($replies['poster_id' == $user_id]){
      $delete = '&lt;a href="#"&gt;Delete&lt;/a&gt;';
  }

  echo $replies['poster_id']?&gt;&lt;/a&gt;&amp;nbsp;¦&amp;nbsp;&lt;?php echo $replies['reply_text']?&gt;&amp;nbsp;¦&amp;nbsp;  &lt;?php echo $delete?&gt;&lt;/div&gt;

  &lt;?php echo "&lt;br /&gt;";
  }

mysql_close($con);
?&gt; 
</code></pre>

<p>Here I have given the user_id which is hardcoded here.
What I got is, delete link is displayed on all comments. I need to display delete link for user_id with "1" only.
Can anyone suggest me to get the solution...Thanks in Advance...</p>
