使用';具有';在CodeIgniter';s活动记录


Using 'having' in CodeIgniter's Active Record

有人知道为什么这个语法不起作用/导致服务器错误吗?

    $this->db->having('post_timestamp >=' . strtotime('last saturday')); 

如果使用MySQL,则查询可能会被转义。试试这个:

$this->db->having('post_timestamp >='. strtotime('last saturday'), NULL, FALSE);