<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.6000.16640" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>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.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>The original sql block code is:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>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-&gt;uid) AND ((users_1.uid)&lt;&gt;$user-&gt;uid)) ORDER BY 
users_1.uid DESC LIMIT 5</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>whereas the php error log messages are like 
this:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV>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 &amp;#039;) AND 
((users_1.uid)&amp;lt;&amp;gt;)) ORDER BY users_1.uid DESC LIMIT 3&amp;#039; 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)&amp;lt;&amp;gt;)) ORDER BY users_1.uid DESC LIMIT 3; in 
/home/mysite/public_html/includes/database.mysql.inc on line 172.</DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>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.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Regards</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Neil</FONT></DIV></BODY></HTML>