[eluser]Unknown[/eluser]
Hi,
I'm a new member in CI community and i'm having problems with bindings variables in SQL queries.
In a model when i use this code
Code:
$sql = "INSERT INTO exp_passager (pass_account, pass_civ, pass_nom) VALUES('{$this->account_id}', '$civility', '$name')";
$query = $this->db->query($sql);
all works fine but when i try to bind inserted values like below,
Code:
$sql = "INSERT INTO exp_passager (pass_account, pass_civ, pass_nom) VALUES(?, ?, ?)";
$query = $this->db->query($sql, $this->account_id, $civility, $name);
a mysql error occurs
Code:
Error Number: 1064
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
INSERT INTO exp_passager (pass_account, pass_civ, pass_nom) VALUES('TOTO',
If there's something i missed could someone tell me what's wrong.
Thanks by advance