[support] Block php errors from Drupal Logs

Saint-Genest Gwenael gwenael.saint-genest at makina-corpus.com
Fri Jun 6 16:07:08 UTC 2008


Hi,

   Where this SQL request is defined ?

   According to php error you have an HTML encoding of the SQL string
sent to mysql (&#039 for "'" ... &lt; for "<" ...). You must decode
string before use with something like html_entity_decode();

Gwen

Neil: esl-lounge.com wrote:
> 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 &#039;) AND ((users_1.uid)&lt;&gt;)) ORDER BY users_1.uid DESC LIMIT 3&#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)&lt;&gt;)) 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
> 

-- 
Gwenael Saint-Genest
MAKINA CORPUS - www.makina-corpus.com
44 boulevard des Pas Enchantés FR-44230 Saint Sébastien sur Loire
Tel : +33 (0) 2 40 94 96 08


More information about the support mailing list