- $r = q("SELECT `c`.`name`, `c`.`nurl`, `q`.`id`, `q`.`network`, `q`.`created`, `q`.`last`
- FROM `queue` AS `q`, `contact` AS `c`
- WHERE `c`.`id` = `q`.`cid`
- ORDER BY `q`.`cid`, `q`.`created`;");
+ $entries = DBA::p("SELECT `contact`.`name`, `contact`.`nurl`,
+ `queue`.`id`, `queue`.`network`, `queue`.`created`, `queue`.`last`
+ FROM `queue` INNER JOIN `contact` ON `contact`.`id` = `queue`.`cid`
+ ORDER BY `queue`.`cid`, `queue`.`created`");
+
+ $r = [];
+ while ($entry = DBA::fetch($entries)) {
+ $entry['created'] = DateTimeFormat::local($entry['created']);
+ $entry['last'] = DateTimeFormat::local($entry['last']);
+ $r[] = $entry;
+ }
+ DBA::close($entries);