I'm trying to figure out the best way to search through a table in a mysql database with php.
the script is taking in a search string, containing an unknown number of words, and they are only being compared to 1 (or possibly 2 fields if its not much harder to do).
i was going to split the string into terms and ereg each term for each row, but that will only show entries which match on any term, wheras most other search systems that i've seen use all terms and sort them. so whats the best way to go about that?
compare each term, give it a score, stick it into an array and then sort it?
or is there something cunning already out there that i dont know about (which php usually has)?
the script is taking in a search string, containing an unknown number of words, and they are only being compared to 1 (or possibly 2 fields if its not much harder to do).
i was going to split the string into terms and ereg each term for each row, but that will only show entries which match on any term, wheras most other search systems that i've seen use all terms and sort them. so whats the best way to go about that?
compare each term, give it a score, stick it into an array and then sort it?
or is there something cunning already out there that i dont know about (which php usually has)?