Wednesday, November 2, 2011

How do I compare two dates in mysql?

This may look very stupid to some of you guys, but I really can't figure it out. I have a table called BORROWS in a database and one of it's fields it's borrow_date. I want to compare it with current date in a php file. Something like this $query="SELECT * FROM 'BORROWS' where borrow_date=date(YYYY-MM-DD)"; $result=mysql_query(query); $row= mysql_num_rows($result). It generates error Mysql num rows(): Invalid argument. Please help

No comments:

Post a Comment