Jump to content

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

 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.