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!
Moderator: General Moderators
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098 Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia
Post
by Chris Corbyn » Thu Mar 10, 2005 6:21 am
Untested.... (Assuming you know what the post id is which is viewed now, and what it is in the DB....
Code: Select all
$uid = $_SESSION['userID'];
$query = "SELECT userID from users WHERE postID='$thisPost' LIMIT 1";
if ($result = mysql_query($query)) {
if (mysql_result($result, 0, 'userID') == $uid) {
echo '<a href="reportedit.php" class="under">EDIT</a>';
} else {
NULL;
}
}
pleigh
Forum Contributor
Posts: 445 Joined: Wed Jan 19, 2005 4:26 am
Post
by pleigh » Fri Mar 11, 2005 12:02 am
also....not working....
pleigh
Forum Contributor
Posts: 445 Joined: Wed Jan 19, 2005 4:26 am
Post
by pleigh » Fri Mar 11, 2005 12:41 am
hey guys, i solved my problem now....in my query, i did this
Code: Select all
$query = "e;SELECT userID FROM posts WHERE userID='$uid' AND postID='$id'"e;;
instead of selecting userID, postID, i just selected userID with a conditions tha userID='$currentsession' and postID='$currentpost