hello.. again to my select query... this is my updated one.
$q = "SELECT
tcs.tutor_id AS tid,
tcs.category_id AS cid,
tcs.subject_id AS sid,
GROUP_CONCAT( DISTINCT s.subjects SEPARATOR ', ') AS subjects,
t.tutor_name AS tname,
t.tutor_code AS tcode,
DATE_FORMAT(t.registration_date, '%b %D, %Y') AS date,
t.qualification AS qualifi,
GROUP_CONCAT( DISTINCT o.option_name SEPARATOR ', ') AS tutor_option,
timg.image_name AS img,
city_name AS city,
d.district_name AS district
FROM tutor_category_subject as tcs
INNER JOIN subject AS s ON tcs.subject_id = s.subject_id
INNER JOIN tutor_option AS toption ON toption.tutor_id = tcs.tutor_id
INNER JOIN options AS o ON toption.option_id = o.option_id
INNER JOIN tutors AS t ON tcs.tutor_id = t.tutor_id
INNER JOIN address ON address.address_id = t.address_id
INNER JOIN city ON city.city_id = address.city_id
INNER JOIN district AS d ON d.district_id = city.district_id
LEFT JOIN tutor_images AS timg ON timg.tutor_id = tcs.tutor_id AND timg.image_type = 'profile'
WHERE s.subjects LIKE '%$subject%'
GROUP BY tcs.tutor_id";
this query is working now.. now I found a problem. it is..... so many subject may have to one particular tutor. I need to select all the subject that pertaining to a tutor with searching keyword to display with search result. In this query searching keyword is '$subject'.
This query only selecting subjects to the tutor similar to the given keyword. For an example if a user give a keyword like 'business' query selecting subjects to that tutor like 'business studies, business accounting., etc only'. so I need to select other subjects too through this query.. can anybody help me?
thank you. [RIGHT][/RIGHT]