Jump to content

[SOLVED] Mysql - datetime query


shotos

Recommended Posts

Hi

i have a table with several columns of which one is of type datetime.

i want to output rows with a specific date say 24-08-2008.

but i keep getting this error

 

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/kwasi/public_html/call.php on line 151

 

this is my code


$query = "select * from Element_$header where year(date_field)='$year' and month(date_field)='$month' and day(day_field)='$day'";

				$result = mysql_query($query,$db->link);

				if(mysql_num_rows($result))

Link to comment
https://forums.phpfreaks.com/topic/121212-solved-mysql-datetime-query/
Share on other sites

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.