The query works, but I get an error trying to see the error but it can not. All variable get "value='1' " when marked....
$tuning = SESSION['tuning']));
$garanciq = (!empty($_SESSION['garanciq']));
$avtopilot = (!empty($_SESSION['avtopilot']));
$servo = (!empty($_SESSION['servo']));
$tiptronik = (!empty($_SESSION['tiptronik']));
$servo = (!empty($_SESSION['servo']));
$service = (!empty($_SESSION['service']));
$bord = (!empty($_SESSION['bord']));
$navi = (!empty($_SESSION['navi']));
$volan = (!empty($_SESSION['volan']));
$zastrahovka = (!empty($_SESSION['zastrahovka']));
$iInsert= new general();
$iInsert->query("INSERT INTO other_checkbox
(tuning, garanciq, avtopilot, servo, tiptronik,
bord_komp, serviz_knijka, navig_sistema, desen_volan,
zastrahovka)
VALUES " . "(:tuning, :garanciq, avtopilot, :servo,
:tiptronik, :bord, :serviceBook, :navi,
:volan, :zastrahovka)");
$iInsert->bind(':tuning', $tuning);
$iInsert->bind(':garanciq', $garanciq);
$iInsert->bind(':avtopilot', $avtopilot);
$iInsert->bind(':servo', $servo);
$iInsert->bind(':tiptronik', $tiptronik);
$iInsert->bind(':bord', $bord);
$iInsert->bind(':serviceBook', $service);
$iInsert->bind(':navi', $navi);
$iInsert->bind(':volan', $volan);
$iInsert->bind(':zastrahovka', $zastrahovka);
$iInsert->execute();
$iInsert->debugDumpParams(); ->get error, but have Fatal Error !
$insert_other_chek = $iInsert->lastInsertId();->get LastInsertId
I get this error
Warning: PDOStatement::execute(): SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens in C:\xampp\htdocs\test\ClassGeneral.php on line 45
Fatal error: Call to undefined method general::debugDumpParams() in C:\xampp\htdocs\test\publicFinish.php on line 165
This is my class General !
class general {
private $db;
private $stmt;
public function __construct() {
$this->db = new connect();
$this->db = $this->db->connectDb();
}
public function query($sql) {
$this->stmt = $this->db->prepare($sql);
}
public function execute() {
return $this->stmt->execute();
}
}