Leute,
vorausgestzt die Tabellen existieren so wie im QUERY, ergibt das keinen Sinn? Es kommt immer ein Fehler.
vorausgestzt die Tabellen existieren so wie im QUERY, ergibt das keinen Sinn? Es kommt immer ein Fehler.
PHP-Code:
$res =& $this->db->query("
SELECT p1.name, p5.comment, lc.name AS companyname, p6.name_f, p6.name_l, p6.title, p6.pic,
concat(p7.picture, '_', p7.width, 'x', p7.height, '.', p7.ext) AS pic_person
FROM (links_company lc, lnk_company_contact lcc, products p1
INNER JOIN lnk_product_pic p2 on p1.pid = p2.pid
INNER JOIN picture p3 on p3.id_pic = p2.id_picture)
LEFT JOIN products_comments p5 on p4.pid = p5.pid
LEFT JOIN contacts p6 on p5.id_person = p6.id
LEFT JOIN contacts_pictures p7 on p7.id_contact = p6.id
WHERE (p1.pid = '".$pid."')
AND (p6.id = lcc.id_contact)
AND (lcc.id_company = lc.id)
AND (lang = '".$language."')");
$comment =& $res->fetchRow(DB_FETCHMODE_ASSOC);
if (isset($comment['comment'])) {
return $comment;
} else {
return false;
}
Kommentar