thara Posted November 27, 2012 Share Posted November 27, 2012 $q = "SELECT keyword, col, city_name, image_name, tutor_code FROM ( SELECT tutor_name AS keyword, 'Tutors' AS col, IFNULL(c1.city_name, '') city_name, IFNULL(ti.image_name, '') image_name, tutor_code FROM tutors AS t LEFT JOIN address a ON t.address_id = a.address_id LEFT JOIN city c1 ON a.city_id = c1.city_id LEFT JOIN tutor_images ti ON t.tutor_id = ti.tutor_id WHERE ti.image_type = 'profile' UNION SELECT subjects AS keyword, 'Subject' AS col, '' city_name, '' image_name, '' tutor_code FROM subject UNION SELECT city_name AS keyword, 'City' AS col, '' city_name, '' image_name, '' tutor_code FROM city UNION SELECT institute_name AS keyword, 'Institute' AS col, '' city_name, '' image_name, '' tutor_code FROM institutes ) s WHERE keyword LIKE '%$queryString%' LIMIT 10"; this query display a list with subjects, tutor names, cities and institutes according the keyword. This is working but If tutors dont have a profile image those tutors not display in the list.. can anybody you tell me why is it? Thanks Link to comment https://forums.phpfreaks.com/topic/271242-query-is-not-working-properly/ Share on other sites More sharing options...
Muddy_Funster Posted November 27, 2012 Share Posted November 27, 2012 deja vu? Link to comment https://forums.phpfreaks.com/topic/271242-query-is-not-working-properly/#findComment-1395504 Share on other sites More sharing options...
thara Posted November 27, 2012 Author Share Posted November 27, 2012 deja vu? what did you mean? Link to comment https://forums.phpfreaks.com/topic/271242-query-is-not-working-properly/#findComment-1395511 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.