I want to delete every row where the time difference is 5 minutes. I’m using time() as an int.
mysql_query("DELETE FROM users WHERE time()-time > 300");
the query is the problem…
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.
time()is a PHP function — and has absolutely no meaning in SQL.You should either :
unix_timestamp(now())might do the trick.time()out of the SQL query, so it’s evaluated by PHP.For example, using the second idea, I suppose you could do something like this :