This query returns 19 as lastInsertId() instead of 000000019. Why?
try {
$stmt = $conn->prepare("INSERT INTO TABLE(NAME) VALUES
(:name)");
$query_params = array(
':name' => $name
);
$stmt->execute($query_params);
echo $conn->lastInsertId();
$response["success"] = 1;
} catch(PDOException $e) {
echo 'ERROR: ' . $e->getMessage();
$response["success"] = 0;
}
It's not a problem because when I insert into another table with the id of 19 it is inserted as 000000019. I just want to know where do the leading zeroes disappear. Haven't found anything about this on Google.