Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save WenLiangTseng/6051493 to your computer and use it in GitHub Desktop.
Save WenLiangTseng/6051493 to your computer and use it in GitHub Desktop.
CodeIgniter 使用日期判斷的 MySQL 語法
<?php
// if you still want to use AR,
// you could pass a FALSE as third parameter of
// $this->db->where
// to avoid automatic escaping by CI:
$this->db->select('id,name')
->where('dr','1')
->where('end >=', 'CURDATE()', FALSE);
$query = $this->db->get('store');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment