I have some front page blocks based on nodeprofile
fields which seem to be working fine and returning expected results. However my
drupal logs are filling up with php errors on every view of the front
page.
The original sql block code is:
SELECT
content_type_nodeprofile.field_country_value, users_1.name, users_1.uid FROM
((users INNER JOIN content_type_nodeprofile ON users.uid =
content_type_nodeprofile.field_uid_value) INNER JOIN content_type_nodeprofile AS
content_type_nodeprofile_1 ON content_type_nodeprofile.field_country_value =
content_type_nodeprofile_1.field_country_value) INNER JOIN users AS users_1 ON
content_type_nodeprofile_1.field_uid_value = users_1.uid WHERE
(((users.uid)=$user->uid) AND ((users_1.uid)<>$user->uid)) ORDER BY
users_1.uid DESC LIMIT 5
whereas the php error log messages are like
this:
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 ') AND
((users_1.uid)<>)) ORDER BY users_1.uid DESC LIMIT 3' at
line 3 query: SELECT content_type_nodeprofile.field_country_value, users_1.name,
users_1.uid FROM ((users INNER JOIN content_type_nodeprofile ON users.uid =
content_type_nodeprofile.field_uid_value) INNER JOIN content_type_nodeprofile AS
content_type_nodeprofile_1 ON content_type_nodeprofile.field_country_value =
content_type_nodeprofile_1.field_country_value) INNER JOIN users AS users_1 ON
content_type_nodeprofile_1.field_uid_value = users_1.uid WHERE (((users.uid)=)
AND ((users_1.uid)<>)) ORDER BY users_1.uid DESC LIMIT 3; in
/home/mysite/public_html/includes/database.mysql.inc on line 172.
as you can see, the WHERE part of the query is
being mangled. What could cause this? As I say, the blocks seem to be working
perfectly so I don't get why the php errors are filling out my log files and why
the WHERE part of the query is getting altered.
Regards
Neil