codeigniter - Select query with Date of Today not working -


i'm trying select table documents date today's date. i'm using codeigniter. shows these documents there isn't hour. mean in database date is: 2015-06-25 00:00:00. doesn't display these documents there hour - example : 2015-06-25 08:34:00. how display documents date current date , no matter hour.

<?php   $date = new datetime("now");      $curr_date = $date->format('y-m-d ');     $this->db->select('*');   $this->db->from('documents');    $this->db->where('date', $curr_date);   $query = $this->db->get();      return $query->result();

try this

<?php  $date = new datetime("now");   $curr_date = $date->format('y-m-d ');   $this->db->select('*');  $this->db->from('documents');   $this->db->where('date(date)',$curr_date);//use date function  $query = $this->db->get();     return $query->result(); 

mysql date function


Comments

Popular posts from this blog

How has firefox/gecko HTML+CSS rendering changed in version 38? -

javascript - Complex json ng-repeat -

jquery - Cloning of rows and columns from the old table into the new with colSpan and rowSpan -