Quote:
Originally Posted by tpr
Hi,
I recived a db error from the vB statistics (already works on my site for a couple of days)
here is the error :
Database error in vBulletin 3.0.6:
Invalid SQL:
SELECT counter
FROM frm_statistic_searchengine_keywords
WHERE keywords = '???\'
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 ''???\'' at line 3
mysql error number: 1064
The forum is in hebrew thus the ??? in the syntax, anyway around this ?
|
I am not the coder of this hack, but try the following changes.
in file statistic_searchengines.php
find:
PHP Code:
$keywords_known = $DB_site->query("
SELECT counter
FROM " . TABLE_PREFIX . "statistic_searchengine_keywords
WHERE keywords = '$keyword_found'
");
Replace by:
PHP Code:
$keywords_known = $DB_site->query("
SELECT counter
FROM " . TABLE_PREFIX . "statistic_searchengine_keywords
WHERE keywords = '" . addslashes($keyword_found) . "'
");
This will be a solution to this one query. I noticed there are more places where this could happen, so just keep adding the 'addslashes()' as you go.