我想获取从现在到一年前的所有记录,但它不能完全正常工作。 用 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();
提前致谢
最佳答案
我忘记在 TimeStamp <= 和 TimeStamp >= 之间添加空格。 我的错。
关于php - 一年前查询日期时间,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19497463/