ridesign Posted December 24, 2005 Share Posted December 24, 2005 Hi, I have a contribution which logs search queries however when any product with a aphostrahe " ' " is searched it returns the following error: 1064 - 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 'aim')' a insert into search_queries (search_text,search_result) values ('a','(pid 119) L'aim') [TEP STOP] Is there a way to resolve this? thanks + merry christmas to everyone Quote Link to comment Share on other sites More sharing options...
Jan Zonjee Posted December 24, 2005 Share Posted December 24, 2005 I have a contribution which logs search queries however when any product with a aphostrahe " ' " is searched it returns the following error: Probably, this contribution does not use the osC way of doing an insert (using function tep_db_perform in includes/functions/database.php) and therefore it doesn't put a backslash in front of the apostrophe, therefore MySQL sees it as the end of the string and when it sees the next apostrophe: error.The function tep_db_perform adds slashes in this line: default: $query .= '\'' . tep_db_input($value) . '\', '; where tep_db_input does the addslashes (a PHP function): function tep_db_input($string) { return addslashes($string); } Smoky Barnable 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.