PHP-Code:
$sql = " SELECT
DISTINCT pic.picture, pd.descr
FROM products AS p, picture AS pic, picture_description AS pd,
lnk_item_pic AS lip, lnk_product_item AS lpi, lnk_product_pic lpp
WHERE p.pid = '".$pid."'
AND pd.lang = '".$language."'
AND pd.id_pic = pic.id_pic
AND p.pid = lpi.pid
AND lpi.id = lip.id_artikelnummer AND
lip.id_bild = pic.id_pic
OR
((p.pid = lpp.pid) AND lpp.id_picture = pic.id_pic AND pic.id_pic = pd.id_pic)";
Kommentar