Time-based file deletion

admin

Administrator
Staff member
I'm trying to get php to access a database and destroy all files in table "stock_quotes" that were in that table previous to the present time (now). Immediately afterwards the program rewrites current data on each stock to the database. I'm using the following code ...

mysql_query("DELETE * FROM stock_quotes WHERE date <= NOW()",$db);

$query = "INSERT into stock_quotes (ticker, lastTrade, lastTradeAt, delta, openedAt, dayRange, volume) VALUES ('$read[0]','$read[1]','$read[2] $read[3]','$read[4]','$read[5]','$read[7] - $read[6]','$read[8]')";

mysql_query($query, $db);


and in the database I assign a timestamp (column name = date) to each entry which is in the format 20010425142236.

For some reason the DELETE command does not seem to be working to eliminate all the "old" files.

Any ideas why this might be happening?

thanks,

chris herold
 
Back
Top