I'm making a form where you can enter your own product and add it to the store (it's a project) but whenever I press on "Add" I keep getting this error message:
Fatal error: Call to a member function execute() on boolean in
$query = "INSERT INTO tbl_product (id, name, image, price, lager, age) VALUES (NULL, :name, :image, :price, :lager, :age)";
$stmt = $mysqli -> prepare($query);
$stmt -> execute(array(
":name" => $name,
":image" => $image,
":price" => $price,
":lager" => $lager,
":age" => $age));
I've checked and all the variables exist and they work, I've tried with echo and so on to check.
Any help is greatly appreciated!
No comments:
Post a Comment