i have a table called suggestion that has columns like title , price , .. and a user_id as fk and every suggestion has one or more than one pics that are stored in suggestion_images table now if i want to get one single suggestion with it's pictures i use this query
SELECT sg.title , sg.price,sg.detail , sg.created_at ,
user.name , user.phone , sg_image.url
from sg
join user on user.id = 16
JOIN sg_image on sg_image.sg_id=sg.id
where sg.id = 13 ;
i join suggestion table and user_table and suggestion_images tables my problem is if the suggestion has 3 image it will make 3 row,s with the same data just Different images .. so is there any way to get one single suggestion and it's pictures in one single row ? or should i query them separately ? or maybe my database disign is wrong ?
edit
this is my suggestion table
id | user_id | title | price | detail | complete | active | track_code | created_at
and this my suggestion_images table
id | url | sg_id
i want to get a suggestion withs it's images that in a row lie
id | title | price | detail | created_at | url_1 | url_2 | ....