Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.