Hi there,

I'm getting the following warning:

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 ')) ORDER BY timestamp DESC' at line 1 query: SELECT timestamp FROM views_content_cache WHERE (()) ORDER BY timestamp DESC in /home/onsorui6/public_html/sites/all/modules/views_content_cache/views_content_cache.module on line 164.

Any idea what could that be?

thank you

Comments

crandallr’s picture

I have the same problem here on openscholar

humansky’s picture

I too am having the same issue. I got the error after I cleared the cache.

freescholar’s picture

Same error after cache clear.
using OpenScholar version of D6x 2.2

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 ')) ORDER BY timestamp DESC' at line 1 query: SELECT timestamp FROM views_content_cache WHERE (()) ORDER BY timestamp DESC in /home/freescho/public_html/sites/all/modules/contrib/views_content_cache/views_content_cache.module on line 164.

technikh’s picture

omnia.ibrahim’s picture

any updates why this error occurred?????

munyiva’s picture

I had the same issue and i followed advice from the thread http://drupal.org/node/946020 , installed Views Content Cache version 6.x-2.x-dev.
I got the following error :

warning: Missing argument 2 for views_content_cache_key_og::view_key(), called in sites/all/modules/openscholar_vsite/vsite_menus/vsite_menus.module on line 446 and defined in sites/all/modules/contrib/views_content_cache/plugins/og.inc on line 39.

warning: Missing argument 2 for views_content_cache_key::view_key(), called in sites/all/modules/os/modules/os_blocks_content_cache/plugins/os_content_cache_context_reaction_block.inc on line 111 and defined in sites/all/modules/contrib/views_content_cache/plugins/base.inc on line 60.

So i went back to Views Content Cache Version 6.x-2.2

then added the following if statement before the SQL on line 165

if ($built_clause['#clause']!='(())') {
$cache[$hash] = db_result(db_query("SELECT timestamp FROM {views_content_cache} WHERE {$built_clause['#clause']} ORDER BY timestamp DESC", $built_clause['#args']));
}

steven jones’s picture

Status: Active » Fixed

This issue should be fixed in 6.x-2.x-dev

Status: Fixed » Closed (fixed)

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

drupalycious’s picture

Status: Closed (fixed) » Active

Sorry for re-opening this issue but in 6.x-2.x-dev the warning that appears is the one described in #6:
With 6.x-2.x-dev the initial warning becomes:

warning: Missing argument 2 for views_content_cache_key_og::view_key(), called in sites/all/modules/openscholar_vsite/vsite_menus/vsite_menus.module on line 446 and defined in sites/all/modules/contrib/views_content_cache/plugins/og.inc on line 39.

warning: Missing argument 2 for views_content_cache_key::view_key(), called in sites/all/modules/os/modules/os_blocks_content_cache/plugins/os_content_cache_context_reaction_block.inc on line 111 and defined in sites/all/modules/contrib/views_content_cache/plugins/base.inc on line 60.

and only by going back to Version 6.x-2.2 and adding the following if statement before the SQL on line 165

if ($built_clause['#clause']!='(())') {
$cache[$hash] = db_result(db_query("SELECT timestamp FROM {views_content_cache} WHERE {$built_clause['#clause']} ORDER BY timestamp DESC", $built_clause['#args']));
}

then the initial warning goes away.

so I just confirm that #6 is the present solution for this issue.
Thanks

rukayya’s picture

Issue summary: View changes

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 'User143@example.com'' at line 1 query: SELECT uid, created FROM users WHERE name = 'Test'User143@example.com' in _db_query() in database.mysqli.inc

I am getting above warning plz do help