[eluser]The Revel[/eluser]
Ok, here is my code igniter query:
Code:
$date1 = $this->input->post('date1');
$date2 = $this->input->post('date2');
$query = $this->db->select('store_id, code, SUM(qty) as qty, SUM(total) as total')
->from('records')
->where('store_id', $this->session->userdata('storeid'))
->where('date BETWEEN "' . $date1 . '" AND "' . $date2 .'"')
->group_by('code')
->get();
if ($query->num_rows() > 0)
{
$this->date['reports'] = $query->result();
}
- I have verified that $date1 and $date2 have the right format - yyyy-mm-dd
- I have verified that the query (shown below) works without error in my SQL editor (SQLyog)
Code:
SELECT store_id, code, SUM(qty) AS qty, SUM(total) AS total FROM records WHERE store_id = '0350C' AND date BETWEEN "2012-05-01" AND "2012-05-31" GROUP BY CODE
above query shows 5 results from database however the Code igniter active Record methods seems to be giving me nothing when I call for the results, so its not passing the variables tot eh next page.