one query instead of four - is it possible?

Posted by Syom on Stack Overflow See other posts from Stack Overflow or by Syom
Published on 2010-05-17T16:46:54Z Indexed on 2010/05/17 16:50 UTC
Read the original article Hit count: 149

Filed under:
|
|

i must get data from four tables. i wrote the script with four queries, but i use it in ajax, and i wan't to do it by one query. here is queries...

$query1 = "SELECT `id`,`name_ar` FROM `tour_type` ORDER BY `order`";
$query2 = "SELECT `id`,`name_ar` FROM `hotel_type` ORDER BY `order`";
$query3 = "SELECT `id`,`name_ar` FROM `food_type` ORDER BY `order`";
$query4 = "SELECT `id`,`name_ar` FROM `cities` WHERE `id_parrent` = '$id_parrent' ORDER BY `name_ar`";

is it possible to write in one query? thanks

© Stack Overflow or respective owner

Related posts about mysql

Related posts about mysql-query