Jump to content
php.lv forumi

LEFT JOIN un where


anonīms

Recommended Posts

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

Guest
This topic is now closed to further replies.
×
×
  • Create New...