I want to display on the page all users who have an avatar installed.
The user record is stored in the user table, the avatar is gallery_foto ( avatar = 1 , which means there is an avatar)
I try to do it like this:
$avatar = mysql_fetch_array(mysql_query("SELECT * FROM `gallery_foto` WHERE `avatar` = '1' LIMIT 1")); $koll = mysql_query("SELECT * FROM `user` WHERE pol <> '".$user['pol']."' AND '".$avatar['id']."' = 1 ORDER BY RAND() LIMIT 1"); while ($uss = mysql_fetch_assoc($koll)) { ///тут вывод рользователей } but displayed with and without avatar.
Where is the mistake?