Sorry very new to PHP and mySQL.
Here is the code there error is referring to.
$query = 'INSERT INTO movies
(title, year, actor, notes, category)
VALUES
(:code, :name, :price, :notes, :category_id)';
$statement = $db->prepare($query);
$statement->bindValue(':title', $code);
$statement->bindValue(':year', $name);
$statement->bindValue(':actor', $price);
$statement->bindValue(':notes', $notes);
$statement->bindValue(':category', $category_id);
$statement->execute();
$statement->closeCursor();
The error is refering to the execute(); statement Any help would be great.
I think it should be like this with proper variable binding, you've used wrong names while doing it. Let's do it-
PDOStatement::bindValue — Binds a value to a parameter.
parameter
value
But in your case you used different names while using
bindValue(). See more http://php.net/manual/en/pdostatement.bindvalue.php