query($query); while($dane=$db->fetchByAssoc($res)){ $i = new EcmInvoiceOut(); $i->retrieve($dane['id']); $i->sendSoap(); } ?>