I'm trying to implement a word search in a mysql table
I have a number search engine that, although very simple, works perfectly:
<?php if ($row['albaran'] == $_POST['buscar']): ?>
<?php endif; ?>
This shows the record if the delivery note is exactly the same as the number that I enter in the search form.
But I would like you to look for a coincidence, that is not exact. For example: Search "Pedro" in a record that is "Pedro Romero Tomas"
I've tried something like this
$buscarcliente = $_POST['buscarcliente'];
sql = 'SELECT * FROM avisos WHERE cliente LIKE "%$buscarcliente%"';