Jump to content

[SOLVED] mysql_num_rows not valid resource???


refiking

Recommended Posts

I am trying to count the number of records in a table called records.  Here is the error message:

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/ctpwebco/public_html/leads/proc.php on line 271

 

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/ctpwebco/public_html/leads/proc.php on line 272

 

Here are lines 271 and 272

$daily = mysql_num_rows($dql);
$weekly = mysql_num_rows($dql);

 

 

Here is the code of what I am trying to accomplish

$date = date("Y:m:d");
$dql = mysql_query("SELECT record_id FROM Records WHERE record_date = '$date'");
$daily = mysql_num_rows($dql);
$weekly = mysql_num_rows($dql);

 

Can anyone tell me how to retrieve the records for an entire week.  Say from Monday to Monday for example.

Link to comment
https://forums.phpfreaks.com/topic/54881-solved-mysql_num_rows-not-valid-resource/
Share on other sites

Looking at your code i cant see what the problem is, sorry  :(

 

To select between weeks i think you do something like this:

 

$dql = mysql_query("SELECT record_id FROM Records WHERE record_date = '$date1 <= $date <= $date2'");

 

Thats just a guess, but i hope it helps,

 

~ Chocopi

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.