Query : SELECT `company`.`company_id`, `company`.`name`, `company`.`description`, `company`.`address`, `company`.`logo_url`, `company`.`location_id`, `company`.`premium_listing`, `company`.`page_alias`, `company`.`url`, `company`.`phone`
FROM `company`, `company_link_location`
WHERE `company`.`company_id` = `company_link_location`.`company_id`
AND `company_link_location`.`location_id` =
AND `company`.`visible` = 1
GROUP BY `company`.`company_id`, `company`.`location_id`
ORDER BY `company`.`premium_listing` DESC, Rand()
LIMIT 0, 100
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 'AND `company`.`visible` = 1
GROUP BY `company`.`company_id`, `company`.`lo' at line 5