What i try to do is check the user's Id by verifying in a cookie (called "identification").
thats my code:
if(!$noCookie) {
$sql = "SELECT * FROM `". TABLE_PREFIX ."_logged` WHERE `logged_cookie` = '". $usersCookie ."' LIMIT 1";
$query = mysql_query($sql) or die(mysql_error());
if (mysql_num_rows($query) <= 0) {
echo 'yes cookie';
$row = mysql_fetch_array($query) or die(mysql_error());
print_r($row);
while ($row=mysql_fetch_array($query)) {
echo $usersId = $row["logged_user_id"];
}
} else {
echo 'no cookie';
}
}
What happends is that if the user's cookie is the same one like in the table, it will return the user's id.
so thats what im trying to do, the IF says "yes cookie", but inside the while it doesnt do anything! and its not giving me an error.