Welcome Guest, Not a member yet? Register   Sign In
How to format date when trying to get all rows created today (active record)
#1

[eluser]rvillalon[/eluser]
Hi Everyone... I have the code I'm using below but I'm not sure how to format the date so I can search by date only. Any ideas?

Code:
$this->db->select("DATE_FORMAT(date_added, '%Y-%m-%d') AS date_added", FALSE);  
$this->db->from($this->order_shipping_table_name);
$this->db->join($this->order_table_name, $this->order_table_name . '.order_id = ' . $this->order_shipping_table_name . '.order_id');
$this->db->where($this->order_shipping_table_name . '.seller_id', $seller_id);
$this->db->where($this->order_table_name . '.date_added', '2011-06-25');
$query = $this->db->get();
$num_rows = $query->num_rows();




Theme © iAndrew 2016 - Forum software by © MyBB