Database error

I am using Dolphin 7.0.6

I received some (very long) emails from the system mentioning:

 

Database error in mt-face

Query:

INSERT INTO `bx_wall_events`(`owner_id`, `object_id`, `type`, `action`, `content`, `title`, `description`, `date`) VALUES('2', '2', 'wall_common_sounds', '', '<div class=\"wall-post-media\">
<div class=\"wall-pm-thumbnail\" style=\"width:144px; height:106px;\">
<a href=\"http://xxxxxx\">
<img class=\"wall-pm-thumbnail\" src=\"http://xxxxx\" style=\"width:144px; height:106px; background-image:url(http://xxxxxx);\" title=\"Μη μ\' αφήσεις\" alt=\"Μη μ\' αφήσεις\" />
</a>
</div>
Μη μ\' αφήσεις, Demo πριν το Νέο Cd 2011
<div class=\"wall-clear\">&nbsp;</div>
</div>', 'nventouratos _wall_added_sounds', 'Μη μ' αφήσεις, Demo πριν το Νέο Cd 2011', UNIX_TIMESTAMP())

Mysql error: 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 'αφήσεις, Demo πριν το Νέο Cd 2011', UNIX_TIMESTAMP())' at line 1

Found error in the file '/home/xxxx/public_html/modules/boonex/wall/classes/BxWallDb.php' at line 59.
Called 'query' function with erroneous argument #0.


Debug backtrace:

...........

 

What causes these? What should I do?

 

Quote · 10 Apr 2011

Looks like your 'description' field is not escaped -> 'Μη μ' αφήσεις, Demo πριν το Νέο Cd 2011', notice the extra ' after your .. u sign.

Try run the same Query with 'Μη μ\' αφήσεις, Demo πριν το Νέο Cd 2011' with an backslach before that ' sign.

Quote · 10 Apr 2011

I didn't run any query. This message came in an email from the system.

Since it says: "Found error in the file '/home/xxxx/public_html/modules/boonex/wall/classes/BxWallDb.php' at line 59.
Called 'query' function with erroneous argument #0", I opened the file, want to lines 59 and 60, where it says these:

59    if((int)$this->query("INSERT INTO `" . $this->_sPrefix . "events`(`" . implode("`, `", array_keys($aParams)) . "`, `date`) VALUES('" . implode("', '", array_values($aParams)) . "', UNIX_TIMESTAMP())") <= 0)
60    return 0;

 

Can anyone understand it?

Quote · 10 Apr 2011

Does the Wall have (query) problem with Greek Language and that causes the error?

 

P.S Can I disable such notification emails if there is no actual problem?

Quote · 10 Apr 2011

The code seems to escape the values, BxWallModule.php line 118 and BxWallResponse.php line 76 does indicate it get escaped.

I don't know exactly the constants of BX_TAGS_NO_ACTION, BX_SLASHES_NO_ACTION but the 'content' field seems get proper escaped so should your title and description be. Could also be a problem of character encoding, eg your website runs character set of 8859-7 and you should be running utf8. I'm just guessing but i had the same problem with mysql_escapeing swedish text on a 8859-1 character set and not until i changed to utf8 everything went ok. If your wall works with english, say 'It's ok' with that extra ' then escaping don't work correctly on your language, migth check that with character encoding above.

Rule of thumb, make sure everything is in utf8, webpages,your database and that you really do an utf8 connection from php to your database.



Quote · 10 Apr 2011
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.