Code: Select all
<?php
// 1st example
$qry = ("SELECT tab.*, table_locations.tl_name FROM tab, table_locations WHERE table_locations.tl_id = $tl_id AND tab.t_tl_id = table_locations.tl_id");
?> Mysql error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'tab, table_locations WHERE table_locations.tl_id = 1' AND `tab`.`t_tl_id`' at line 1
Code: Select all
<?php
// 2nd example
$the_qry = ("SELECT `tab`.*, `table_locations`.`tl_name` FROM `tab`, `table_locations` WHERE `table_locations`.`tl_id` = $tl_id AND `tab`.`t_tl_id` = `table_locations`.`tl_id`");
// 3rd example
$the_qry = ("SELECT `tab`.*, `table_locations`.`tl_name` FROM `tab`, table_locations WHERE table_locations.tl_id = $tl_id AND tab.t_tl_id = table_locations.tl_id");
?> Thanks