PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
I have a database in MySql and runs fine - yet the server I am on is a Windows running MySql 5.0 and not 5.1.6 - unable to run cron job with this version and also windows i understand does not support.... So I have created a PHP script that I hope will provide the same results - but when I run it, the data in my database does not delete as intended... Could you folks review my script and possibly any othe thoughts on how to achieve this function...
"DELETE FROM users
WHERE `signup_date` <DATE_SUB(CURDATE(), INTERVAL 1 DAY)'"
)
MySQL said:
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mysql_query("DELETE FROM users
WHERE `signup_date` <DATE_SUB(CURDATE(), INTERV' at line 1
removed the extra ' and ran the test and received this:
Error
SQL query:
mysql_query(
"DELETE FROM users
WHERE `signup_date` <DATE_SUB(CURDATE(), INTERVAL 1 DAY)"
)
MySQL said:
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mysql_query("DELETE FROM users
WHERE `signup_date` <DATE_SUB(CURDATE(), INTERV' at line 1
OK sorry - disregard the previous post reply - forgot the "); - Finally - this works and deletes the record from the database - outstanding... now the next problem is how do I get the PHP to run by itself - the Windows server I am on does not feature Cronjob?