Re: [PHP-DB] Flush database

2002-09-30 Thread wade
Could anyone help me to figure out how to write a piece of code that says if the time now time( ) is greater than 1 hour of the time( )then do something. I have a script that gets the time as of now and I also have the time of (lets say then) stored in a database. how would I write the code to sa

Re: [PHP-DB] Flush database

2002-09-27 Thread wade
Thank you, I think this will help me greatly. It was the mktime(function) that was throwing me for a loop. Thank you all for your help also! Micah Stevens wrote: > Using UNIX timestamps: > > if (time() - $timestamp > mktime(1,0,0,0,0,0)) { > // Difference it greater than one hour

Re: [PHP-DB] Flush database

2002-09-27 Thread Micah Stevens
Using UNIX timestamps: if (time() - $timestamp > mktime(1,0,0,0,0,0)) { // Difference it greater than one hour. Perform rejection code here } else { // Difference is one hour or less. Perform acception code here. } At 04:35 PM 9/27/2002 -0500, wade wrote: >So how w

Re: [PHP-DB] Flush database

2002-09-27 Thread Brad Bonkoski
Sounds like we are all on similar pages with timestamping, but if you issue a delete query every time the page is viewed it could create some sub-par performance based on number of hits. i.e. if the site gets 100 hits in the first 10 minutes of operation, it would issue delete logic and queries 1

Re: [PHP-DB] Flush database

2002-09-27 Thread Jim Hunter
First make sure that you are storing the IP and the time it was saved in the database. Then I would have 3 queries: 1) a query to see if the IP address is in the database and less then an hour old. 2) a query to save the IP and time into the database 3) a query to delete all entries over 1 hou

Re: [PHP-DB] Flush database

2002-09-27 Thread Brad Bonkoski
How about writting the IP address to the database with a timestamp, then when a matching IP address arrives you view the timestamp and if it has been more then a hour, they can view the page, which would force you to update the timestamp. Of course you would probably need to write a stand-alone (

Re: [PHP-DB] Flush database

2002-09-27 Thread Ignatius Reilly
why not simply store the server time at log in in the DB after a successful log in together with the IP address; and at the next log in request perform a SQL time difference comparison? Ignatius - Original Message - From: "wade" <[EMAIL PROTECT