Jump to content

Yet another little problem!


paulman888888

Recommended Posts

Hi guys;

 

Simple question

WHAT HAVE I DONE WRONG?

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/site/2.php on line 21
Thats the error!

$ephp9=date('y').'/'.date('m').'/28';
$event_28 = mysql_num_rows(mysql_query("SELECT FROM chess_events WHERE thedate='$ephp9'"));

Heres the code!

 

 

Thankyou All

Paul

 

Link to comment
https://forums.phpfreaks.com/topic/134642-yet-another-little-problem/
Share on other sites

$ephp9=date('y').'/'.date('m').'/28';
$event_28_result = mysql_query("SELECT FROM chess_events WHERE thedate='$ephp9'") or die(mysql_error());
$event_28 = mysql_num_rows($event_28_result);

 

edit: also, the date format for MySQL is: YYYY-MM-DD

$ephp9=sprintf('%s-%s-28',date('Y'),date('m'));

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.