Mysql select in multiple tables
Posted: 02 Apr 2017, 19:51
Hi! i have this database select query:
But if i have multiple record with same id in section_images i get this in different results.
Code: Select all
// Interogare sql SELECT
$sql = "SELECT `location`.`id` , `location`.`location` , `location`.`customer` , `area`.`id` , `area`.`area` , `area`.`id_principal` , `area_description`.`id` , `area_description`.`description` , `area_description`.`id_area` , `area_images`.`id` , `area_images`.`patch`, `area_images`.`id_area`, `section`.`id_principal` , `section`.`id_principal` , `section`.`area_id` ,`section`.`section` , `section_description`.`description` , `section_description`.`id_principal` , `section_images`.`patch` , `section_images`.`id_principal`
FROM `location` , `area` , `area_images` , `area_description` , `section` , `section_description` , `section_images`
where `location`.`id`= `area`.`id_principal` AND `area_description`.`id_area` = `area`.`id` AND `area_images`.`id_area` = `area`.`id` AND `section`.`id_principal` = `location`.`id` AND `section_description`.`id_principal` = `location`.`id` AND `section_images`.`id_principal` = `location`.`id` ";