PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
i would like to add eid(for edit id) after or before the cid....is this possible??i would like to declare eid and cid and use GET method to another page...
$editquery = "SELECT postID, username, commentID FROM comments WHERE postID='$id' AND username='$uname'";
$editresult = @mysql_query($editquery) or die(mysql_error());
if (mysql_fetch_assoc($editresult))
{
// $edit = '<a href="reportcommentedit.php?cid='.$_GET['pid'].'" class=under>EDIT</a>';
$edit = '<a href="reportcommentedit.php?eid='.$_GET['pid'].'&cid='.$row[3].'" class=under>EDIT</a>';
}
else
{
$edit = ' ';
}
when i try to point the cursor to the edit link, eid is getting its value from another table....from the posts table...and not from $row[2] which is the commentID from comments table...
$editquery = "SELECT postID, username, commentID FROM comments WHERE postID='$id' AND username='$uname'";
$editresult = @mysql_query($editquery) or die(mysql_error());
if ($row = mysql_fetch_assoc($editresult))
{
$edit = '<a href="reportcommentedit.php?eid='.$_GET['pid'].'&cid='.$row['commentID'].'" class=under>EDIT</a>';
}
else
{
$edit = ' ';
}
it worked but there is a problem...when pointing over the edit link....the value of cid is the same as the other edit links....for example....i have 3 links, 1 of the comments has an id (cid=7)..the cid of the other 2 id is the same(cid=7)...when i tried to update it, that one with the cid=7 is the only comment that is updated, even if its the other comments i am editing....
Just don't restrict your query to the postid, but only the username, then get all the comments by username but getting their postid's for each one. make sense?