I am trying to quickly determine if a user_ID is the owner of a \'goal\'. I believe my SQL query is good, but I\'m trying to find a nice way of checking the result!
This way is probably faster.
$query = "SELECT EXISTS (SELECT * FROM goals WHERE goal_ID='$obj_id' AND user_ID='$user_id')"; if(mysql_num_rows(mysqli_query($query)) < 1) { // Nothing found! }