I've been trying to make a search engine that will look for an already defined word, but the search engine comes up with different result even if i type the exact word. For example, if i type in: "James", the results will show up everything that begins with "Ja" or any other letter from the name "James". If i type in "James", i want the results to show me "James" only, and nothing else. The names will be pre-defined. I use something like this: "WHERE name LIKE '%$name%'" Code (markup): , but this shows up multiple results, instead of one exact result OR multiple exact results. Any help?
Thanks, but i've just tried and it doesn't show any results even though i've written the exact word. I'll look again to see if i'm doing something wrong.
Probably...damn this is really frustrating. How long did it took you guys to get to that point where you could easily code something using PHP by just searching on the internet?
years. nobody said it was going to be easy, lol. actually, make that never. it's never easy...always have to use our heads and keep trying. just make sure you're not mixing up letter cases...i think WHERE name = 'James' is not the same as WHERE name = 'james'...
It is the same unless you set the field to binary I believe^ WHERE `name` = '$name' Code (markup): should do fine...
Haven't noticed any difference. Anyway, i was able to display all the usernames of the database without using the search function, so that means the problem is the search function itself. I've tried using Google to find some PHP written search engines, but those are way too complicated. Oh and can anyone answer the question above?