So I know this error/question has been posted/asked a lot on SO, but none of the answers helped me and I kept getting this error:
Fatal error: Call to a member function bind_param() on a non-object
Here is the relevant code:
$connect = new mysqli(connection info);
$search = $_POST["search"];
$sql = $connect->prepare("SELECT name, seller FROM products
WHERE name LIKE '%' + ? + '%';");
$sql->bind_param("s", $search);
?>
I believe it has something to do with the like clause, but I am not sure. I am a inexperienced SQL and PHP coder.
Help is greatly appreciated!