0

First of all, I have a database in which I store people's data. Then, there's a PHP page whose function is to search that database and retrieve suggestions while I type. So far, I'm using this:

$pdo->prepare("SELECT * FROM people WHERE people.name = $name");

But the problem is, it only shows the suggestion when I type the full name that's stored in the DB. How can I make it search for a substring inside the name column, retrieving all people with that substring in their names?

0 Answers0