Count the number of rows
Posted: Wed Feb 09, 2011 3:57 pm
I am trying to runa query which will feed data into a graph however when trying to get the affected rows in the query i am returned with zero when i know for sure there are rows that match the criteria. below is the code:
Basically the search is finding any dates within a date range for a particular body part for the user
Is there something wrong with my logic?
Basically the search is finding any dates within a date range for a particular body part for the user
Code: Select all
$partQuery = mysql_query("SELECT DateEntered, $part FROM indBody WHERE MemberID = '$id' AND DateEntered >= DATE_SUB(CURDATE(), INTERVAL '$view' DAY) AND CURDATE() ORDER BY DateEntered");
$count = mysql_num_rows($partQuery);
echo "count is : ". $count;