I am comparing songnames from two tables to find a match. My query looks like this:
$querymvideo = "select movietable.id, movietable.songname from movietable where TRIM(movietable.songname) LIKE '__$foo' "; The above query works fine except when a songname has the single quote symbol: "'" or maybe it is the comma in the song. Example song: I'll See the Light, Tonight This gives an error: Warning: Supplied argument is not a valid MySQL result resource in /testing/dirlisting4e.php on line 208 MySQL error 1064: You have an error in your SQL syntax near 'll See the Light, Tonight' ' at line 1........ How to escape or ignore the single quote: "'" in a variable. Can I use the escape clause somehow in my query: ESCAPE '''; I am using PHP and MySQL --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php