Re: [PHP] php + mysql - timstamp - calculate hours remaining

2006-01-12 Thread Gregory Machin
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

Re: [PHP] php + mysql - timstamp - calculate hours remaining

2006-01-10 Thread M. Sokolewicz
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

Re: [PHP] php + mysql - timstamp - calculate hours remaining

2006-01-10 Thread David Grant
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

RE: [PHP] php + mysql - timstamp - calculate hours remaining

2006-01-10 Thread Albert
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.

RE: [PHP] php + mysql - timstamp - calculate hours remaining

2006-01-10 Thread Albert
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.

Re: [PHP] php + mysql - timstamp - calculate hours remaining

2006-01-10 Thread David Grant
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