I'm getting the following error
Warning: PDOStatement::execute(): SQLSTATE[HY093]:
Invalid parameter number: number of bound variables does not match number of tokens
When I'm trying to update MySQL database.
Here is the code my using.
public function update() {
global $db;
$stmt = $db->prepare("UPDATE products SET Name='?', Cate_id='?', Price='?', Image='?', Special='?', Special_price='?', Disable='?' WHERE PID = ?;");
$stmt->execute(array($this->name, $this->category, $this->price, $this->image, $this->special, $this->special_price, $this->disable, $this->id));
}
;from"UPDATE products SET Name='?', Cate_id='?', Price='?', Image='?', Special='?', Special_price='?', Disable='?' WHERE PID = ?;"and running again? i have seen issues caused by;while binding the parameters