AyKay47 Posted August 5, 2011 Share Posted August 5, 2011 when you post code, the color coder can show you where you are messing up in your code mysql_query("DELETE FROM users WHERE `signup_date` <DATE_SUB(CURDATE(), INTERVAL 1 DAY)"); Quote Link to comment https://forums.phpfreaks.com/topic/243960-php-script-review-need-solution/page/2/#findComment-1252732 Share on other sites More sharing options...
jjfletcher90 Posted August 5, 2011 Author Share Posted August 5, 2011 retested and submitted a new record and changed the date to two (2) days ago and: successful in deleting record from within the phpmyadmin DELETE FROM users WHERE `signup_date` <DATE_SUB(CURDATE(), INTERVAL 1 DAY) yet received this error when the php script is run from the browser: Parse error: syntax error, unexpected $end in test.php on line 13 Quote Link to comment https://forums.phpfreaks.com/topic/243960-php-script-review-need-solution/page/2/#findComment-1252733 Share on other sites More sharing options...
jjfletcher90 Posted August 5, 2011 Author Share Posted August 5, 2011 Line 13 of this script is the end: ?> Quote Link to comment https://forums.phpfreaks.com/topic/243960-php-script-review-need-solution/page/2/#findComment-1252735 Share on other sites More sharing options...
AyKay47 Posted August 5, 2011 Share Posted August 5, 2011 <?php $db = mysql_connect("removed credentials"); if (!$db) { die('Could not connect: ' . mysql_error()); } mysql_select_db("databasename", $db); mysql_query("DELETE FROM users WHERE `signup_date` < DATE_SUB(CURDATE(), INTERVAL 1 DAY)"); mysql_close($db); ?> there is no unexpected end here... Quote Link to comment https://forums.phpfreaks.com/topic/243960-php-script-review-need-solution/page/2/#findComment-1252736 Share on other sites More sharing options...
jjfletcher90 Posted August 5, 2011 Author Share Posted August 5, 2011 OK.... cut and pasted your exact code: which is basically identical to mine except line spaces etc... <?php $db = mysql_connect("removed credentials"); if (!$db) { die('Could not connect: ' . mysql_error()); } mysql_select_db("databasename", $db); mysql_query("DELETE FROM users WHERE `signup_date` < DATE_SUB(CURDATE(), INTERVAL 1 DAY)"); mysql_close($db); ?> into the text editor and pushed via FTP to the server and ran the PHP script.... This is the error on the web browser: Parse error: syntax error, unexpected $end in test.php on line 8 Quote Link to comment https://forums.phpfreaks.com/topic/243960-php-script-review-need-solution/page/2/#findComment-1252743 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.