UnknownPlayer Posted November 9, 2010 Share Posted November 9, 2010 How can i use $query = "SELECT * FROM klanovi WHERE naziv = '{$trazi}' OR tag = '{$trazi}'"; but i need to search from base where that $trazi is contained in naziv or tag, i mean like wildacards? And how can i search that text but no matter of lowercase or uppercase ? Quote Link to comment Share on other sites More sharing options...
requinix Posted November 10, 2010 Share Posted November 10, 2010 Use LIKE. It'll probably be case-insensitive for you. "...WHERE naziv LIKE '%{$trazi}%' OR tag LIKE '%{$trazi}%'" Quote Link to comment Share on other sites More sharing options...
wigpip Posted November 10, 2010 Share Posted November 10, 2010 $trazi = strtolower($trazi); $trazi = preg_replace('/\s+/', '|', $trazi); then lower(naziv) REGEXP '$trazi' these are a few pointers as to the functions you will need to use, REGEXP is more forgiving and the preg_replace with OR lets it seach within www.wigpip.com.au 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.