You bet it is but with a little work. I will assume you are on LAMP
server (Linux, Apache, MySQL, PHP) and provide a general framework for
hot to accomplish this task as I do it now for a customized
replication environment for updating a server that communicates with a
wireless client. You can code the rest for your task.
In the database table add a column with a timestamp field in it. In
mysql the first column of this type will automatically be populated
with the current timestamp by default (a nice feature).
Note: I am not responsible for syntax errors.
CREATE TABLE hotspot
( id MEDIUMINT UNSIGNED NOT NULL
AUTO_INCREMENT PRIMARY KEY
, active_flag CHAR(1) NOT NULL DEFAULT 'Y'
, name VARCHAR(75) NOT NULL
, update_date TIMESTAMP
, comments TEXT
, INDEX name_idx (name)
) TYPE=InnoDB;
The insert statement to create the record would look like:
insert into hotspot (name, comments) values ('mytest', 'Nothing worth
mentioning');
Next, write a php script that then connects to the database and all
that. At this point say you want to find all of the records that are
older than a day you would issue the following sql statement
$sql = 'SELECT id FROM hotspot WHERE update_date >
DATE_SUB(CURRENT_DATE(), INTERVAL 1 DAY)';
$result = mysql_query($sql, $conn);
while ($row = mysql_fetch_object($result)) {
$deleteRecordSet[] = $row->id;
}
foreach ($deleteRecordSet as $row) {
$sql = "delete from hotspot where id = $row->id";
....
}
You can then setup a cron job to run this php script using a command
line tool like curl (which you should install if you system doesn't
have it)
0 4 * * * curl
http://localhost:81/deleteHotspots.php >>
/log/deleteexport.log
Hope that helps!
wes bailey
"The Lone Wolf" <jc*************@pandora.be> wrote in message
news:<8X******************@afrodite.telenet-ops.be>...
Hi,
is it possible to put somekind of parameter on a table that when i put data
into the table it automaticly erase the row when a certain time has past??
i know i can use cookies on the client side but i like to create a simelar
effect on the server side.
is this possible???
thanks