I get an error with this SUBSELECT?
$common_dimensions_query = "
SELECT *
FROM main_products_common_dimensions d
WHERE d.product_id = (SELECT id FROM main_products WHERE abbreviation = '".$product."'";
The error:
Warning: pg_query() [function.pg-query]: Query failed: ERROR: syntax error at end of input LINE 4: … (SELECT id FROM main_products WHERE abbreviation = ‘banner’ ^ in
Is there anyway to do a LEFT JOIN here instead?
A version with JOIN instead of double SELECT: