So in my php script I compare the current time (date()) with the time from the mysql database but it doesn’t work. How do I do this?
PHP
if($row['Datum'] < date(Y-m-d-H-i-s)) { Code to execute}
Mysql DATETIME
2012-11-13 17:00:00
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Your current code has syntax errors, but it’s pretty close to something that would work:
This is likely to be inside a loop, so you should cache the output of
date():You could also do the comparison directly in the query: