我想从现在开始一年前获取所有记录,但它不能正确工作。 Made in CodeIgniter一年以前查询日期时间
这是我的查询,有什么不对吗? :
$currentDate = date("Y-m-d H:m:s");
$yeardate=date('Y-m-d H:m:s', strtotime('-1 year'));
$this->db->select('TimeStamp');
$this->db->where('Transaction', 'COMPLETED');
$this->db->where('TimeStamp>=',$yeardate);
$this->db->where('TimeStamp<=',$currentDate);
$query = $this->db->get('R_Logs');
$results = $query->result();
在此先感谢
定义'不能精确地工作.'。 –
在我的SQL中出现错误 – David