Page 2 of 2

Posted: Thu Mar 10, 2005 6:21 am
by Chris Corbyn
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;
    }
}

Posted: Fri Mar 11, 2005 12:02 am
by pleigh
also....not working.... :(

[SOLVED]link restriction help

Posted: Fri Mar 11, 2005 12:41 am
by pleigh
hey guys, i solved my problem now....in my query, i did this

Code: Select all

$query = &quote;SELECT userID FROM posts WHERE userID='$uid' AND postID='$id'&quote;;
instead of selecting userID, postID, i just selected userID with a conditions tha userID='$currentsession' and postID='$currentpost