query($sql); $result = array(); if (!is_a($res, 'PEAR_Error')) { while ($val = $res->fetchRow()) { $val['date'] = substr($val['created'], 0, 10); // Strip the time. $result[] = $val; } return $result; } return false; } }