W dniu 21.04.2012 10:05, JOYNET napisał(a):
tak, tez robilem, ale problem jest z tym zapytaniem: tak wyglada oryginal: // get documents data $docs = $DB->GetAllByKey('SELECT documents.id AS id, number, cdate, customerid, userid, name, address, zip, city, ten, ssn, template, reference, extnumber, paytime, closed FROM documents LEFT JOIN numberplans ON numberplanid = numberplans.id WHERE (type = ? OR type = ?) AND (cdate BETWEEN ? AND ?) ', 'id', array(DOC_INVOICE, DOC_CNOTE, $unixfrom, $unixto));
a tak po zmianie;
// get documents data $docs = $DB->GetAllByKey('SELECT documents.id AS id,
imessengers.uid AS nrfv, number, cdate, customerid, userid, name, address, zip, city, ten, ssn, template, reference, extnumber, paytime, closed FROM documents LEFT JOIN imessengers ON (imessengers.customerid = documents.customerid) AND (imessengers.type = 1) LEFT JOIN numberplans ON numberplanid = numberplans.id WHERE (type = ? OR type = ?) AND (cdate BETWEEN ? AND ?) ', 'id', array(DOC_INVOICE, DOC_CNOTE, $unixfrom, $unixto));
po ktorej nie laduje juz zadnych danych do exportu...
Wstaw zapytanie: SELECT documents.id AS id, imessengers.uid AS nrfv, number, cdate, customerid, userid, name, address, zip, city, ten, ssn, template, reference, extnumber, paytime, closed FROM documents LEFT JOIN imessengers ON (imessengers.customerid = documents.customerid) AND (imessengers.type = 1) LEFT JOIN numberplans ON numberplanid = numberplans.id;
i zobacz jaki będzie błąd.
uczestnicy (1)
-
Tomasz Chiliński