Closed (fixed)
Project:
Account reminder
Version:
5.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
9 Apr 2007 at 16:37 UTC
Updated:
30 Mar 2008 at 15:34 UTC
I'm getting the following in the logs:
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 '(NOW(), b.last_reminder) AS date_diff FROM users a LEFT JOIN ac query: SELECT a.*, b.msg_cnt, DATEDIFF(NOW(), b.last_reminder) AS date_diff FROM users a LEFT JOIN account_reminder b ON b.uid=a.uid WHERE a.access=0 AND a.uid!=0 AND status=1 in /home/dcourt2/public_html/forum/includes/database.mysql.inc on line 121.
gil
Comments
Comment #1
Nigeria commentedGot the same error in drupal 5.1
Comment #2
prateek commentedI think its the same as:
http://drupal.org/node/123962
I am facing it on Drupal 5.1.
It seems that the query string is malformed. I am not able to see the actual query string, so I cannot comment further.
Comment #3
prateek commentedOK guys, I found the solution. But excuse me for its not in "patch" format.
just change the query line in cron hook function to the one given below:
Looks like there is some bug in either PHP or MySQL. DATEDIFF function doesn't work at all.
Comment #4
gaijinu commentedAdd table prefix:
$result=db_query("DELETE {account_reminder}.* FROM {account_reminder},{users} WHERE {account_reminder}.uid={users}.uid AND access!=0 AND {users}.uid!=0 AND status=1");Comment #5
cojones commentedThe delete is not valid SQL in any database except mysql, I know it doesn't work in postgres
This should work
DELETE FROM {account_reminder} WHERE account_reminder.uid in (SELECT users.uid FROM {users} WHERE access!=0 AND users.uid!=0 AND status=1)
Comment #6
jaydub commentedThe latest commit to CVS should take care of these issues. I've changed the table
structure to accomodate PostgreSQL and altered the date logic in the SQL as a result.
Please take a chance to test out!
Comment #7
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.