Morning all,
How can I make the below code more efficient? How do I place it in loop?
thanks,
Kevin.
// inserting to archive from rights
$query1 = "INSERT INTO archive(name, type, size, content, file_date) SELECT name, type, size, content, file_date FROM rights WHERE CURDATE() >= DATE_ADD(file_date, INTERVAL 1 DAY)";
$result1 = mysql_query($query1) or die(mysql_error());
// inserting to archive from spin offs
$query2 = "INSERT INTO archive(name, type, size, content, file_date) SELECT name, type, size, content, file_date FROM spin_offs WHERE CURDATE() >= DATE_ADD(file_date, INTERVAL 1 DAY)";
$result2 = mysql_query($query2) or die(mysql_error());
// inserting to archive from splits
$query3 = "INSERT INTO archive(name, type, size, content, file_date) SELECT name, type, size, content, file_date FROM splits WHERE CURDATE() >= DATE_ADD(file_date, INTERVAL 1 DAY)";
$result3 = mysql_query($query3) or die(mysql_error());