I have a user table, where users need to be approved, i want to show users who are not approved and is registered more than 7 days ago.
My user_regdate is a timestamp created with php time() function.
This is what i try, it does not works:
mysql_query("select * from users WHERE user_regdate < now() - interval 7 day AND approved='0' order by id;");
Thanks
PHP’s timstamps are a simple integer, whereas MySQL’s
now()returns a datetime value. Most likely this will fix up the query:Basically, without the unix_timstamp() call, you’re comparing apples and oranges.