Skip to content

Instantly share code, notes, and snippets.

@ptasker
Created June 20, 2012 16:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ptasker/2960851 to your computer and use it in GitHub Desktop.
Save ptasker/2960851 to your computer and use it in GitHub Desktop.
Codeigniter - Model get by FBID and Date
<?php
public function get_by_fbid( $fbid ) {
$where = "fbid = {$fbid} AND DATE_FORMAT(date_modified, \"%Y-%m-%d\") = CURDATE()";
$this->db->select( 'id' )
->from( 'entries' )
->where( $where );
$query = $this->db->get();
return $query->result();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment