Why?
try{
$st = $this->prepare("INSERT INTO thetable (a,b) VALUES (?,?)");
$st->execute(array(5,5));
$id = $this->lastInsertId();
echo $id; // nothing
echo gettype($id); // string
return $id; // and I get NULL returned, this is even weirder...
}catch(PDOException $e){
die($e);
return false;
}
The table has an id column which has auto increment. Why don’t I get the id value?
instead of
have you tried