Re: Flush database
| From: | Brad Bonkoski | Date: | Fri, 27 Sep 2002 21:07:20 +0000 |
| Subject: | Re: Flush database | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-22058@lists.php.net to get a copy of this message | ||
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 (i.e. non-web) php script that would act as a cron job to clean
out the database periodically, whatever period you define (depending on
traffic and size of DB).
-Brad
wade wrote:
> 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