anonīms Posted June 17, 2012 Report Posted June 17, 2012 Uz sitienu nenāk nekas galvā.. SELECT store_products.*,files.file AS image FROM `store_products` LEFT JOIN `files` ON files.entity_id = store_products.id WHERE store_products.category = '".$category->id."' AND store_products.status = 1 AND files.type = 'image' GROUP BY store_products.id ORDER BY store_products.id DESC, files.fid ASC kā atspoguļot produktus arī tad, ja `files` ar šo produkta id ir tukšs? jo pašlaik šķiet, ka AND files.type = 'image' visu sabojā...
marrtins Posted June 17, 2012 Report Posted June 17, 2012 Varbūt (files.entity_id is NULL or files.type = 'image')
xPtv45z Posted June 17, 2012 Report Posted June 17, 2012 ... LEFT JOIN `files` ON files.entity_id = store_products.id AND files.type = 'image' WHERE ...
Recommended Posts