0

I am Trying to create a search bar to search for a Title that is stored in the table already using php. To find the title I have to input the exact title ex. Input: (Title) Output: (Title). I want it so all you have to do is type a part of the word and the query filters for the titles with those words: Input: (tle) Output: (Title, First_Title). Is this possible to do with the query or do I have to use something else? The $Unexact variable is the variable used as the input.

$name = mysql_query("SELECT * FROM information WHERE Title='".$UnExact."'") or die ('Error: '.mysql_error ());

1 Answers1

1

Try this (using mysqli extension)

$name = $mysqli->query("SELECT * FROM information WHERE LOWER(Title) LIKE '%". strtolower ($UnExact) ."%'");
atomCode
  • 842
  • 7
  • 17