I have two table
table 1:
row | car_id | car_model |
1 1 CAR 1
2 2 CAR 2
3 3 CAR 3
4 4 CAR 4
table 2:
row | car_id | car_features |
1 1 Features 1
2 2 Features 2
3 2 Features 3
What I want to display :
row | car_id | car_model | car_features |
1 1 CAR 1 Features 1
2 2 CAR 2 Features 2,Features 3
3 3 CAR 3
4 4 CAR 4
if I using group concat with group by
there will display row 1,2 and I want to display all the rows...
row | car_id | car_model | car_features |
1 1 CAR 1 Features 1
2 2 CAR 2 Features 2,Features 3
Please send me the sql statement..THANK!!
this is my query
$format = mysql_query("SELECT c.* , p.*, d.*,f.* ,GROUP_CONCAT(DISTINCT e.features_title SEPARATOR '<br>') AS 'car_features' FROM bsi_car_master c,bsi_car_type p, bsi_car_vendor d, bsi_selected_features f, bsi_car_features e WHERE c.car_type_id=p.id AND c.car_vendor_id=d.id AND c.car_id = f.car_id AND f.features_id = e.id GROUP BY c.car_id");