Welcome Guest, Not a member yet? Register   Sign In
CRUD: Select from Date Range
#1

[eluser]Unknown[/eluser]
I was hoping someone could point me in the right direction with this snippet of code. I'm trying to pull a specific date range from a database.

Here is my code snippet...

Model:
Code:
$code = $this->session->userdata('code');
$start_date = $this->input->get_post('start_date');
$end_date = $this->input->get_post('end_date');

$query = $this->db->where('code', $code )->where('request_date >=', $start_date)->where('request_date >=',$end_date)->get( 'dispatch' );
        
            if( $query->num_rows() > 0 ) {
                return $query->result();
            } else {
                echo "No records found...";
                return array();
            }

Currently it grabs the records but ignores the date ranges completely. Any help would be greatly appreciated!


Messages In This Thread
CRUD: Select from Date Range - by El Forum - 10-04-2010, 03:50 PM
CRUD: Select from Date Range - by El Forum - 10-04-2010, 06:27 PM
CRUD: Select from Date Range - by El Forum - 10-05-2010, 04:18 AM



Theme © iAndrew 2016 - Forum software by © MyBB