Forum Moderators: coopster
Here is my code so far {
$username = $session->username;
$result=mysql_query("SELECT * FROM $replies WHERE entry_id = '$id' ORDER by reply_id DESC");
while ($i = mysql_fetch_array($result))
{
$replies = $i;
if ($replies['poster_id'] == $username){
$delete = '<a href="delete?where='.$id.'&reply='.$replies['reply_id'].'">Delete</a>';
}
?>
<div>
<div><a href="profiles/<?php echo $replies['poster_id']?>"><?php echo $replies['poster_id']?></a> ¦ <?php echo $replies['post_time']?> ¦ <?php echo $delete?></div>
<div><?php echo $replies['reply_text']?></div>
</div><br/><br/>
<?
}
Now, heres the problem. The delete link should only show up on comments left by the logged in user. But the link shows up on ALL comments as long as the logged in user has left at least one comment. If the user has left no comments, no delete link is shown.
Any idea what im doing wrong?