onedumbcoder Posted April 17, 2009 Share Posted April 17, 2009 "SELECT id FROM food WHERE strtolower(str_replace(' ','',name)) = strtolower(str_replace(' ','','$name'))" Quote Link to comment https://forums.phpfreaks.com/topic/154449-why-doesnt-this-query-work/ Share on other sites More sharing options...
PFMaBiSmAd Posted April 17, 2009 Share Posted April 17, 2009 You have php functions inside of a string, where they are simply characters that are part of the string and have no special meaning. You would either need to break up the string so that the php functions are not contained inside of the string or write your query using the equivalent mysql functions and syntax (assuming you wanted mysql to perform those actions instead of php.) Quote Link to comment https://forums.phpfreaks.com/topic/154449-why-doesnt-this-query-work/#findComment-812108 Share on other sites More sharing options...
onedumbcoder Posted April 17, 2009 Author Share Posted April 17, 2009 can you pleasee tell me what the mysql equviliance to those two functions are? thank you Quote Link to comment https://forums.phpfreaks.com/topic/154449-why-doesnt-this-query-work/#findComment-812120 Share on other sites More sharing options...
PFMaBiSmAd Posted April 17, 2009 Share Posted April 17, 2009 http://dev.mysql.com/doc/refman/5.0/en/string-functions.html Quote Link to comment https://forums.phpfreaks.com/topic/154449-why-doesnt-this-query-work/#findComment-812122 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.