Error on Cron Job
frerin - June 9, 2008 - 05:22
| Project: | Inactive User |
| Version: | 5.x-1.2 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Jump to:
Description
Hi,
each time my Cron runs I get this error:
user warning: 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 query: SELECT uid FROM dp5inactive_users WHERE uid <> 1) in /www/includes/database.mysql.inc on line 172.
What might be the problem and how can I fix it?
Thanks for help in advance.

#1
That closing parenthesis after the 1 on line 235 does not belong.
#2
Line 235 is the following code.
// reset notifications if recent user activity
$users = db_fetch_object(db_query('SELECT uid FROM {inactive_users} WHERE uid <> 1'));
I think that the was the wrong line.
I think it could be line 268:
$result = db_query('SELECT * FROM {users} WHERE access < (%d - %d) AND status <> 0 AND uid <> 1)', time(), $notify_time);which should be
$result = db_query('SELECT * FROM {users} WHERE access < (%d - %d) AND status <> 0 AND uid <> 1', time(), $notify_time);#3
It was the same problem on many lines which was fixed in 1.3 and 1.4. Just try upgrading.
#4
Automatically closed -- issue fixed for two weeks with no activity.