SQL = "DELETE FROM table WHERE date_added < " & date()-14
I found this snippet of SQL that I need to run an auto delete record cron job. I have no experience in either. Can anyone help explain how this part works and how it is setup in cpanel?
Posted 26 August 2010 - 03:54 PM
SQL = "DELETE FROM table WHERE date_added < " & date()-14
Save the environment, use green text
Some Bullshit Somewhere
Posted 26 August 2010 - 06:54 PM
NZ.org | BBPCG
Discord: The Astronomer#1314
Steam
Posted 26 August 2010 - 09:11 PM
DELETE FROM tabledoes the word table mean the "name of the table" or is the word table literal? I've googled and there seems to be a lot of different codes to do it. But I'm confused...
Save the environment, use green text
Some Bullshit Somewhere
Posted 27 August 2010 - 09:24 AM
In SQL written by non-sloppy people capitalised words are keywords while the others are names.does the word table mean the "name of the table" or is the word table literal?
DELETE FROM table WHERE date_added < (NOW() - INTERVAL 14 DAYS)This is assuming you want to delete records older than 14 days. I don't know exactly what the PHP bit "date() - 14" returns, but it's certainly not the time 14 days ago
Posted 27 August 2010 - 11:32 PM
Save the environment, use green text
Some Bullshit Somewhere
Posted 28 August 2010 - 11:13 AM
Posted 29 August 2010 - 04:01 AM
Save the environment, use green text
Some Bullshit Somewhere
0 members, 1 guests, 0 anonymous users