On 05.04.2012 12:30, Tomasz Chiliński wrote:
Nikt nie wie ??? Próbowałem tak :
$customerdocuments = $DB->GetAll('SELECT number, cdate, paytime, value, description FROM documents, debitnotecontents WHERE customerid = ? AND type=5 AND closed=0 AND id=docid', array($cid));
Ale nic nie zwraca. Czy typ 5 to nota obciążeniowa ?
Nic nie zwraca bo jest błąd w zapytaniu. 1. type=5 możesz ominąć w tym przypadku. 2. warunek id=docid jest błędny ponieważ obie tabele zawierają kolumnę id. SELECT number, cdate, paytime, value, description FROM documents JOIN debitnotecontents ON (documents.id = debitnotecontents.docid) WHERE customerid = ? AND closed = 0 -- Aleksander 'A.L.E.C' Machniak LAN Management System Developer [http://lms.org.pl] Roundcube Webmail Developer [http://roundcube.net] --------------------------------------------------- PGP: 19359DC1 @@ GG: 2275252 @@ WWW: http://alec.pl