I have this bit of code:
//Restrict the SQL query with an AND clause if a member has been selected
if ($form_member_id != 0) {
$query .= "AND photos.member_id = '$form_member_id' ";
}
It is meant to refine a search query down to only the selected user, so the whole query together reads:
SELECT
photos.photo_id, members.member_name, photos.photo_title, photos.photo_film, photos.photo_height, photos.photo_width
FROM members, photos
WHERE members.member_id = photos.member_id
AND photos.member_id = '$form_member_id'
For some reason this does not work, ive tested the query and it works fine, but for some reason it wont work with the code ive written. I've checked for difference in the names of the variables but they are all the same....anyone know why its not working!!!