corillo181 Posted July 4, 2007 Share Posted July 4, 2007 so i always use php for mydates stuff but i was reading on something and i saw that is better to user mysql to do dates comparison for my queries. but how do i do this kind of search <?php $month=date("m"); $query=mysql_query("SELECT * FROM tra_party WHERE DATE_FORMAT('date','%m')='$month'"); ?> date is a field in my tra_party table. Quote Link to comment Share on other sites More sharing options...
mmarif4u Posted July 4, 2007 Share Posted July 4, 2007 Assume that date is a field in ur table: than do it like this: $query=mysql_query("SELECT * FROM tra_party WHERE DATE_FORMAT(date,'%m')='$month'"); Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.