anonīms Posted June 17, 2012 Report Share 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ā... Link to comment Share on other sites More sharing options...
marrtins Posted June 17, 2012 Report Share Posted June 17, 2012 Varbūt (files.entity_id is NULL or files.type = 'image') Link to comment Share on other sites More sharing options...
xPtv45z Posted June 17, 2012 Report Share Posted June 17, 2012 ... LEFT JOIN `files` ON files.entity_id = store_products.id AND files.type = 'image' WHERE ... Link to comment Share on other sites More sharing options...
anonīms Posted June 18, 2012 Author Report Share Posted June 18, 2012 xPtv45z der! Link to comment Share on other sites More sharing options...
Recommended Posts