I have the following doubt, I am doing a search engine, that I look for in my database a product that contains some letter in its name, I make the query in phpmyadmin and all good, it works for me, the problem comes when I pass by parameter from the input, and I do not know how to make the parameter pass through the bindParam, here I leave the code, could you give me a hand? It's not been long since I started with this php, thank you very much!
$Buscar= $_POST{'busca'};
$sql ="select p.idProducto, p.nombre_producto, p.precio, c.nombre_categoria
as categoria, p.stock, p.detalles from productos p join categorias
c on c.id_categoria = p.id_categoria where p.idEstadoEliminacion = 1
and nombre_producto like '%:busca%'";
//
$sentencia = $con->prepare($sql);
$sentencia-> bindParam(':busca', $Buscar, PDO::PARAM_STR);