i want to go inside the if statment if i have both things in one row.
so if i have image_id = $image_id_g and user_id=$user_id_s on same row. i wan tto go inside the if statment.
but this is not working. i thinkg this query is testing two things sepeartly. i want to check if two things are true in same row. not different rows.

if(!$tester = mysql_query("SELECT * FROM image WHERE  image_id = '$image_id_g' AND user_id = '$user_id_s'"))
6 Years
Discussion Span
Last Post by minitauros

What you're doing is checking if the mysql query is being executed correctly. $tester will be set to true if the query could be executed, or to false if it could not. You should rather use something like: $results = mysql_fetch_assoc($tester); And then check if $results has any records. If it has, results could be found for the query that was just executed. If not, no results were found.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.