Jump to content

PHP Script Review - need solution!


jjfletcher90

Recommended Posts

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

<?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...

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

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.