onedumbcoder Posted July 22, 2009 Share Posted July 22, 2009 How do I protect against the % character in a LIKE %$searchtearm% Quote Link to comment https://forums.phpfreaks.com/topic/166942-how-do-you-protect-against-a/ Share on other sites More sharing options...
jayjay960 Posted July 22, 2009 Share Posted July 22, 2009 Do you mean to escape it so it's treated like a normal character? \% The backslash is used to escape characters in most programming languages (eg echo 'abc\'def'; in PHP will show as abc'def ) Quote Link to comment https://forums.phpfreaks.com/topic/166942-how-do-you-protect-against-a/#findComment-880211 Share on other sites More sharing options...
onedumbcoder Posted July 22, 2009 Author Share Posted July 22, 2009 will mysql_real_escape_string do that? or is there another function that takes care of that? Quote Link to comment https://forums.phpfreaks.com/topic/166942-how-do-you-protect-against-a/#findComment-880328 Share on other sites More sharing options...
fenway Posted July 24, 2009 Share Posted July 24, 2009 will mysql_real_escape_string do that? or is there another function that takes care of that? The refman is your friend. Quote Link to comment https://forums.phpfreaks.com/topic/166942-how-do-you-protect-against-a/#findComment-882305 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.