jcadima
3/26/2016 - 7:22 PM

Strip Time from Date

Strip Time from Date

http://stackoverflow.com/questions/267721/mysql-strip-time-component-from-datetime

to convert '2008-11-05 14:30:00' to '2008-11-05'
USE:  SELECT date(my_date)


/*--------------------------------------------------------------
	SEARCH ORDERS BY DATE
--------------------------------------------------------------*/
	public function searchOrdersByDate( $start, $end ) {
		$this->db->query("SELECT order_id, event_id, address, city, state, zipcode, first_name, last_name, email, amount, fees, date_added 
						  FROM orders
						  WHERE date(date_added) >= :start
						  AND date(date_added) <= :end  ");
							
		$this->db->bind(':start', $start);
		$this->db->bind(':end', $end);
		// Assign row
		$row = $this->db->resultset();
		return $row;
	}