I have problem with SQL query.
I have table in my database which stores attendance of students.
It has fields Teacher_Id, Roll_No, Date, Present('0' if student is absent on that date and '1' if present).
I wrote following query
SELECT count(Present ) , sum( Present ) FROM attendance_info WHERE Teacher_Id ='12' AND Roll_No = 2 AND Date BETWEEN '2011-03-09' AND '2011-03-15'
It works fine when I run it in query analyzer but when i integrated it in PHP code, it didn't gave any results for sum and count was 0.
Is there any way to store count and sum in PHP variables?
Plz do answer.