I have the name in mysql database table like Mohan Krishna
. How we can search for that name using php with searching like mohankrishna
name?
SELECT * FROM tablename
WHERE LOWER(REPLACE(name,' ','')) LIKE LOWER('%mohankrishna%')
I'm not 100% sure, but could be a good approach.
One way would be, using the full text functionality of MySQL.
Another way by using LIKE
in your SELECT
-query just like.
SELECT * FROM users WHERE username LIKE "mohankrishna";
But I'm not really familiar with this and I don't know how tolerant MySQL is to give you the exact record.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With