Hi everyone,
am quite a newbie to php/mysql, and am onto my first site. I have setup a mySQL database and filled it with a lot of data. I have a search form on my site used to search my dB.
I found the search not working well. It seems to ignore many records which obviously has my search pattern.
For example, I have a column called 'director'
where one of the record value is 'Soumitra Ranade'
Now, when I search for 'S' or 'So' or 'Sou', my query is successful, and it returns me the row with "Soumitra Ranade".
But when I search for 'Soum' or 'Soumitra' or the whole bloody 'Soumitra Ranade', which is a much better match, it fails to return me anything.
There are many more such records, which fail to turn up as search results.
I did try changing the datatype of the 'director' column to text, varchar, but no change in result.
I guess am doing something very basically stupid, so If any of you gurus did come across something similar and know of a solution, please let me know ... very much appreciated.
my echoed queries are like this :
Returns correct result 🙂
SELECT mID, plant, year, FROM indicomptable WHERE srcCount > 0 AND director LIKE '%s%'
Returns correct result
SELECT mID, plant, year, FROM indicomptable WHERE srcCount > 0 AND director LIKE '%so%'
Returns correct result
SELECT mID, plant, year, FROM indicomptable WHERE srcCount > 0 AND director LIKE '%sou%'
Doesnot Returns correct result 🙁
SELECT mID, plant, year, FROM indicomptable WHERE srcCount > 0 AND director LIKE '%soum%'
Doesnot Returns correct result
SELECT mID, plant, year, FROM indicomptable WHERE srcCount > 0 AND director LIKE '%soumi%'
Doesnot Returns correct result
SELECT mID, plant, year, FROM indicomptable WHERE srcCount > 0 AND director LIKE '%soumit%'
Doesnot Returns correct result
SELECT mID, plant, year, FROM indicomptable WHERE srcCount > 0 AND director LIKE '%soumitra%'
Doesnot Returns correct result
SELECT mID, plant, year, FROM indicomptable WHERE srcCount > 0 AND director LIKE '%soumitra ranade%'
Doesnot Returns correct result, tho its a perfect match :eek:
SELECT mID, plant, year, FROM indicomptable WHERE srcCount > 0 AND director LIKE '%Soumitra Ranade%'
thanks for reading
S