wrathican Posted July 22, 2007 Share Posted July 22, 2007 hi ive followed the tutorial located here: http://www.phpfreaks.com/tutorials/144/0.php i havin problems with it. i get this warning: Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in F:\wamp\www\test\calendar.php on line 15 which i guess means that my query has failed and there is not data in the database... but i changed the values in the intitial SQL to mirror the current year and so i do have some dates in the database any ideas>? Link to comment https://forums.phpfreaks.com/topic/61227-php-calendar/ Share on other sites More sharing options...
AndyB Posted July 22, 2007 Share Posted July 22, 2007 Whether you have data or not, it means the query failed. Modifying the code so that it echoes out the query (after creating it, before executing it) should point you in the right direction. Link to comment https://forums.phpfreaks.com/topic/61227-php-calendar/#findComment-304627 Share on other sites More sharing options...
wrathican Posted July 22, 2007 Author Share Posted July 22, 2007 well i have echoed out the query and here it is: SELECT DAY(event_date) AS day, COUNT(event_id) FROM calendar_events WHERE MONTH(event_date) = '07' AND YEAR(event_date) = '2007' GROUP BY day Link to comment https://forums.phpfreaks.com/topic/61227-php-calendar/#findComment-304635 Share on other sites More sharing options...
simple_man_11 Posted July 22, 2007 Share Posted July 22, 2007 I would try to login to your database and run a simular query directly using phpadmin or however you connect and run something simular if your having problems with your script. It looks like there may be something wrong with your sql script. Link to comment https://forums.phpfreaks.com/topic/61227-php-calendar/#findComment-304711 Share on other sites More sharing options...
wrathican Posted July 22, 2007 Author Share Posted July 22, 2007 hey. thanks for the reply. i tried running the sql in phpMyAdmin and it said that i had an arror in my sql query: #1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '( event_date ) AS DAY , COUNT( event_id ) FROM calendar_event ^^ is the error it gave me is this a propper sql statement? Link to comment https://forums.phpfreaks.com/topic/61227-php-calendar/#findComment-304735 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.