I would suggest storing the modified timestamp or something similar in the database with the email address (assuming, of course, that you're storing the email in a database).
You could query this timestamp at the application level to see if 24 hours has passed, and you could even implement it into the SQL query as a fallback. Something along the lines of "UPDATE example_table SET email = '[email protected]' WHERE id = '1' AND (modified_timestamp + '1 day'::interval) <= now()". I'm a PostgreSQL user, and don't use MySQL often, so not sure without looking up the reference on the syntax for MySQL. Hope that helps. Thanks, Nathan. http://kturl.com/control -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Anthony Power Sent: Friday, 7 May 2010 3:10 p.m. To: NZ PHP Users Group Subject: [phpug] php query every 24hrs Hey guys , What best way in php to make it that user can only update a every 24hrs , EG user one update e-mail then he will not be able to set a new e-mail for 24hrs? -- NZ PHP Users Group: http://groups.google.com/group/nzphpug To post, send email to [email protected] To unsubscribe, send email to [email protected] -- NZ PHP Users Group: http://groups.google.com/group/nzphpug To post, send email to [email protected] To unsubscribe, send email to [email protected]
