I'm grabbing from a table everything I need to create a CSV file. It's lovely, the way that it works:
header('Content-Disposition: attachment; filename='.$filename);
$dan="delete from twitter_csv where session_id='$session_id'";
My problem is what I want to happen after I "echo $output." I need to delete everything in the table that coincides with that session_id. It's not happening. This morning my table is upwards of 2,000,000 rows which means I've got a monster that is growing in in power and size and I've got to keep it manageable.
What's wrong with my logic? Why isn't my table cleared of all data after it's created the CSV file and what can I do to correct my error?