Posted by drw on April 1, 2009 at 5:46pm
Jump to:
| Project: | SIOC |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | support request |
| Priority: | normal |
| Assigned: | drw |
| Status: | active |
Issue Summary
Sometimes received this 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 'WHERE (n.language ='es' OR n.language ='' OR n.language IS NULL)' at
line 1 query: SELECT COUNT(*) as count from node where type = 'story' WHERE
(n.language ='es' OR n.language ='' OR n.language IS NULL)
in /mnt/disk2/pruebas/utplsite/modules/sioc/sioc.module on line 521.
What happend it ?
Comments
#1
"where type = 'story'" WHERE should be "where type = 'story' AND"
Not sure why that is happening...
#2
In the Drupal 5 and 6 modules, the line:
$stories_counter = db_result(db_query('SELECT COUNT(*) as count from {node} where type=\'story\''));
was changed to:
$stories_counter = db_result(db_query(db_rewrite_sql('SELECT COUNT(*) as count from {node} where type=\'story\'')));
I'm not sure what the effect will be of removing the rewrite function...
scor, any ideas?