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

deekayen - June 9, 2008 - 13:22
Status:active» fixed

That closing parenthesis after the 1 on line 235 does not belong.

#2

frerin - June 14, 2008 - 07:05

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

deekayen - June 15, 2008 - 04:24

It was the same problem on many lines which was fixed in 1.3 and 1.4. Just try upgrading.

#4

Anonymous (not verified) - June 29, 2008 - 04:32
Status:fixed» closed

Automatically closed -- issue fixed for two weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.