SQL error on stats page
-
While running on a testing server (set to show errors) I am seeing SQL errors caused by an un-slashed aprostrophe in an SQL statement (see error message below).
The problem is data that has not been through addslashes:
‘where’s hillary hosta’
should have been
‘where\’s hillary hosta’The problem can be fixed by adding
$keywordData = addslashes($keywordData);
just above
if($keyword_interval == “today”)
which is line 131 in keyword stats.php.WordPress database 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 ‘s hillary hosta’ AND stat_visitor_id not in(”)’ at line 1]
select keyword,stat_visitor_id,visitor_id from wp_tts_keyword_stats where keyword=’where’s hillary hosta’ AND stat_visitor_id not in(”)
- The topic ‘SQL error on stats page’ is closed to new replies.