Hi, Can you help me please on this, i want to get the last inserted id but it gives me on this error
72SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens
Here is my code
function addCredit($a,$b){
try{
$con = new Connection();
$dbh = $con->dbconnection();
$dbq=$dbh->prepare('INSERT into credit (cr_x,cr_y) values (?,?)');
$dbq->execute(array($a,$b));
$id = $dbh->lastInsertId();
echo $id;
$dbh=null;
return "Completed";
}
catch(PDOException $e){
return $e->getMessage();
}
}
Thank you in advance.