Jump to content

jjfletcher90

Members
  • Posts

    29
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

jjfletcher90's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. 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
  2. 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
  3. I'm just getting darn right angry now... this is the new error after all the changes: 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); ?>
  4. Showing rows 0 - 0 (1 total, Query took 0.0047 sec) SQL query: SELECT signup_date FROM users ORDER BY signup_date DESC LIMIT 10
  5. I ran this from within phpmyadmin: and the record deleted... I went in and edited the date to reflect 2 days ago and then it deleted... So.... When I run the PHP from the browser this is the error recieved: Parse error: syntax error, unexpected $end in test.php on line 14 This is the modified code: <?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); ?> Thanks for helping me Guys - your awsome!
  6. changed the test: SELECT * FROM `users` WHERE `signup_date` < DATE_SUB( CURDATE( ) , INTERVAL 1 DAY ) and received this result: MySQL returned an empty result set (i.e. zero rows). (Query took 0.0100 sec)
  7. These are the columns in the table that I am using - am I calling on the right column to delete the requested record based on lapsed time? userid | first_name | last_name | email_address | username | password | info | user_level | signup_date | last_login | activated
  8. Deleted rows: 0 (Query took 0.0004 sec) SQL query: DELETE FROM users WHERE `signup_date` < DATE_SUB( CURDATE( ) , INTERVAL 1 DAY ) checked to see if the sample data was deleted from the table and it is still there - huh? Looks like progress to me - at least no errors! No to actually deleted the record when requested...
  9. MySql version is 5.0 (Goddady) - this error seems to be referring to the version of the database not the code???
  10. removered the " enclosed and re-ran the test: Error SQL 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 ')' at line 1
  11. Error There seems to be an error in your SQL query. The MySQL server error output below, if there is any, may also help you in diagnosing the problem ERROR: Unclosed quote @ 75 STR: " SQL: DELETE FROM users WHERE `signup_date` <DATE_SUB(CURDATE(), INTERVAL 1 DAY)"); SQL 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 '")' at line 2
  12. I ran this from within phpmyadmin: mysql_query("DELETE FROM users WHERE `signup_date` <DATE_SUB(CURDATE(), INTERVAL 1 DAY)"); and received the error - when I run the PHP from a browser it does nothing - no error nor message at all
  13. This is all in testing stages - trying to get the code to delete a record in the database after a set amount of time has passed: the code I am testing is: <?php $db = mysql_connect("credentials removed"); 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); ?>
  14. I recieve the following errors: 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
×
×
  • 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.