While setting a user online or offline status with the Views module, I get this error message:

SQLSTATE[42000]: Syntax error or access violation: 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 ')) < 30, 1, 0) AS users_node_is_online, 1 AS expression FROM node node LEFT JOI' at line 1

How do I fix it?

  • It's not clear to me when you get that error. The Views module should not allow you to set the status of a user's account. May you explain with more details what you were doing?
    – apaderno
    Commented Jul 14, 2012 at 20:22
  • well, i just wanna show users online status. Is a website is online or offline. To do so i add this status field in views and then this error appear. What to do to fix it?
    – rakibtg
    Commented Jul 15, 2012 at 7:38

1 Answer 1


I believe the field meh is referring to is provided by the user_stats module. Indeed, once installed it is possible to add that field in a views. There is also a patch for this error on the user_stats issue queue.

  • Thanks for your response :) but i am not using Drupal anymore :)
    – rakibtg
    Commented Jan 16, 2015 at 8:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.