I am working on an ajax search form.
With my current SQL query, it only returns the result when I have the keyword value from the search form EXACTLY the same as the value of a record in the database.
$sql = "SELECT * FROM events WHERE name LIKE '%" . $_POST["search"] . "'";
Example:
"New York Marathon"
The result will not show until I've typed out "New York Marathon" fully.
How can I modify the query to show the result when I start typing "N..". I would like to apply this for all search terms