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 hour old.

Then when you get a new visitor see if the IP address is in the database and
is not less then 1 hour old. Once it clears that test, save the IP and time,
then always run the delete query to clear out entries. If you have a lot of
traffic to your site you are going to generate a lot of database hits. 

Good luck.
Jim
 
-------Original Message-------
 
From: wade
Date: Friday, September 27, 2002 02:02:50 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Flush database
 
I am storing IP addresses in a database, but after an hour has passed I
want to delete all the IP addresses from that database. I want to do
this based on the server time. Example.. Someone comes to my web page, I
store their IP address in my database. So now I write a PHP script that
says if that IP returns to my page within an hour, they can't view my
page. If they come back after an hour has passed they can view the
contents of that page. but only after an hour has passed.

Can anyone help me with the syntax or functions that will clear the
database after an hour of waiting has passed?
Is this possible? Any suggestions, logic or any help on this matter will
be greatly appreciated.

Thank you

--
Should you have any questions, comments or concerns, feel free to call
me at 318-338-2033.

Thank you for your time,

Wade Kelley, Design Engineer
================================================
Bayou Internet...(888) 30-BAYOU...http://www.bayou.com
Mississippi Internet...(800) MISSISSIPPI...http://www.mississippi.net
Vicksburg Online...(800) MISSISSIPPI...http://www.vicksburg.com
================================================




-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

. 


Reply via email to