Date in MySQL and PHP the best way to accomplish
Posted on 2007-04-04
I have this table (number (int), task (varchar 80) date (date)).
What I want is the ability to search for a task in a specific date, or between two dates.
I don't know if the table structure that I have created is correct or not. Or the best way to accomplish this task?
I tried running this query in PHP
$query = "SELECT task FROM taskmngr WHERE date between '2002-08-06' and '2007-04-30'";
But I got this error:
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in C:\location\all.php on line 14
No data to display!
Here is line 14:
$numrows = mysql_num_rows($result);
Could someone please help me?