How to write database query to search month in date field in Codeigniter's way?

Up vote 0 down vote favorite share g+ share fb share tw.

Thanks in Advance :) "SELECT attendanceno FROM attendance WHERE (barcodeid = '$studentid') AND (month(attendancedate)='$month' AND year(attendancedate)='$year') "; Edit Thanks to Stefan, who answered my question below. After reading his post I also tried the following script and found it working. That's why I just wanted to share in case anyone wants to use it.

But all credit goes to Stefan. :) $this->db->select('*'); $this->db->from('attendance'); $this->db->where('barcodeid', $studentid); $this->db->where('month(attendancedate)', $month); $this->db->where('year(attendancedate) ', $year); $this->db->order_by('attendancedate ','ASC'); $getData = $this->db->get('', $perPage, $uri); codeigniter codeigniter-2 link|improve this question edited Jan 3 at 6:04 asked Jan 2 at 16:08Srijon2438 59% accept rate.

Thanks for your reply. Please check the edited part of my question. – Srijon Jan 3 at 6:06.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions