paulman888888 Posted November 28, 2008 Share Posted November 28, 2008 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 21Thats 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 More sharing options...
rhodesa Posted November 28, 2008 Share Posted November 28, 2008 $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')); Link to comment https://forums.phpfreaks.com/topic/134642-yet-another-little-problem/#findComment-701035 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.