0

html body mysql result:

<?
$sqlcomments = "SELECT * from sellercomments where Status=1 and SellerID=".$_REQUEST['SellerID']. " order by AddedDate desc";
$resultcomments= mysql_query($sqlcomments);
if (@mysql_num_rows($resultcomments)!=0){
?>
<br>
<?
while($row_comments = @mysql_fetch_array($resultcomments))
{
?>
<div align="right"><img src="../<?=$row_sellerdetails['AboutUsImage']?>" width="40" height="40" border="0"></div>
<?=$row_comments['CommentBy']?>] to <a href="index.php?SellerID=<?=$_REQUEST['SellerID']?>">
<?=$row_sellerdetails['idName']?></a>
<span style="color:#000000"><?=$row_comments['Comment']?></span> <br>
<?
}
}
?>  

------ end: want to delete this comment result?>>>

3
Contributors
2
Replies
12
Views
4 Years
Discussion Span
Last Post by Szabi Zsoldos
0

you can set a variable and use an id

<a href="?delete=<?php echo $row('id'); ?>">Delete</a>

if(isset($_GET['delete']) && !empty($_GET['delete'])) {
    $sql = mysql_query("DELETE FROM yourTable WHERE id = '".mysql_real_escape_string($_GET['delete'])."'");

    if(!$sql) {
        echo 'Error during delete #'.mysql_error()';
    }
}
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.