Many Thanks for the help.
OP 2 worked a treat.. now i need to run it at midnight, I was going to
write a php script and call it vai crontab, but how could I iplament
this a triger and stored procedure ?
On 1/10/06, M. Sokolewicz <[EMAIL PROTECTED]> wrote:
>
> David Grant wrote:
> > Gr
David Grant wrote:
Gregory,
David Grant wrote:
Gregory Machin wrote:
I have a table with a timestamp column and would like to use his to
calculate the age of the record . how would i go about this...
I would also like to exicute a mysql stament that pasess the tables and
removes fields older
Gregory,
David Grant wrote:
> Gregory Machin wrote:
>> I have a table with a timestamp column and would like to use his to
>> calculate the age of the record . how would i go about this...
>> I would also like to exicute a mysql stament that pasess the tables and
>> removes fields older than say 7
I wrote:
> Delete the records from the table:
> mysql_query("DELETE FROM table WHERE timestamp >= '$timestamp'") or
> die('Could not delete from table');
That query should be
DELETE FROM table WHERE timestamp <= '$timestamp'
Sorry about that.
Albert
--
No virus found in this outgoing message.
Gregory Machin wrote:
> I have a table with a timestamp column and would like to use his to
> calculate the age of the record . how would i go about this...
Convert your timestamp to a unix timestamp (see mktime() function).
Use the value returned by time() to calculate the difference in seconds.
Gregory,
Gregory Machin wrote:
> I have a table with a timestamp column and would like to use his to
> calculate the age of the record . how would i go about this...
> I would also like to exicute a mysql stament that pasess the tables and
> removes fields older than say 72 hours. how would i go a
6 matches
Mail list logo