Pdo V20 Extended Features File
pdo v20 extended features » pdo v20 extended features
Pdo V20 Extended Features File
Old PDO had messy error handling. Modern extended features clean it up.
$stmt = $pdo->prepare("SELECT * FROM activity_log", [
PDO::ATTR_CURSOR => PDO::CURSOR_SCROLL
]);
$stmt->execute();
$lastRow = $stmt->fetch(PDO::FETCH_ASSOC, PDO::FETCH_ORI_LAST);
$firstRow = $stmt->fetch(PDO::FETCH_ASSOC, PDO::FETCH_ORI_FIRST);
The most critical change in v2.0 is under the hood. Historically, PDO was tightly coupled with mysqlnd for MySQL support and required complex C-level boilerplates for other drivers. pdo v20 extended features
PDO v2.0 introduces a new, lightweight abstraction layer. Old PDO had messy error handling