takn25 Posted April 4, 2011 Share Posted April 4, 2011 Hi, I have a row called date, in my table which Is filled with $date_r = date("Y-m-d"); Which is the current date. I want to know in which format or what other function should I use to fill the row so it can be used in query to display all the events that are happening on the particular day for instance on that date example Today is the 4/4/2011 and the row date in the table is also 4/4/2011 IF the current date is the same as the table date I want to echo something. Could some one tell me in which format will I be posting the date so it can be used in a query and will I need to use the NOW() function or the curdate(); If some one could shed some light on these two functions because I have not been able to find some good information on these or am I going in the wrong direction Quote Link to comment https://forums.phpfreaks.com/topic/232666-another-question-need-help-with-understanding-date/ Share on other sites More sharing options...
Stooney Posted April 4, 2011 Share Posted April 4, 2011 $result=mysql_query("SELECT some_field FROM some_table WHERE date='".date('Y-m-d')."'"); If you are wanting to store a new value which includes the current date, you would use NOW() Quote Link to comment https://forums.phpfreaks.com/topic/232666-another-question-need-help-with-understanding-date/#findComment-1196710 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.