Hey, i wrote some queries yesterday: one to get the total number of posts in my forum from one day and another to get the total number of posts in my forum since its creation. Now, yesterday they worked and output the correct information but now its gone on to another day, nothing is being output at all :-S
Heres the queries:
$poststoday = mysql_num_rows(mysql_query("SELECT * FROM Forum_Replies WHERE reply_postdate=CURDATE()",$connection)) or die(mysql_error());
echo "<br>Posts Today: ".$poststoday;
$poststotal = mysql_num_rows(mysql_query("SELECT * FROM Forum_Replies WHERE reply_postdate<=CURDATE()",$connection)) or die(mysql_error());
echo "<br>Total Number of Posts: ".$poststotal;
I've got a feeling its got something to do with the WHERE part of the queries but i'm not 100% sure :-S So if anyone has any clues to why this wouldnt output anything when moving to a new day i would appreciate it 🙂
Cheers, BIOSTALL
EDIT: Right, i added or die(mysql_error()) after the mysql_query and now i'm getting the error:
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/virtual/site13/fst/var/www/html/ForumMain.php on line 396
This is the line that the first query is on..... I need to only select the data from where the date in my table is less than the current date so this WHERE criteria that i am using is the only to do it isnt it?