I am running MySQL version 5.1.57
I have a HTML form where a user can insert a search-string. I create a $_SESSION
on this string, then I run it in a MySQL
query. Something like this:
<?php
$sql = mysql_query ("SELECT
s.student_firstname, s.student_lastname
FROM students s
WHERE (
s.student_firstname LIKE '%$searchstring%' OR
s.student_lastname LIKE '%$searchstring%
)
AND s.isActive = '1' ");
?>
The problem is when a user is searching for multiple words. Then my query fails because it is trying to match the string against the values in either column.
I've read something about MySQL FULLTEXT indexing but as far as I understand, it only works on MyISAM
tables(?). How can I be able to search for multiple words using the environment that I have?