Pdo V2.0 Extended Features Info

Eliminates need for manual fetchColumn(0) or fetch(PDO::FETCH_COLUMN) . 2.2 Named Placeholders with Native Array Unpacking PDO 2.0 extends named placeholder support to automatically unpack associative arrays without binding each parameter individually.

| Method | Description | Example | |--------|-------------|---------| | fetchScalar() | Returns single column from first row | $count = $pdo->fetchScalar("SELECT COUNT(*) FROM users"); | | fetchSingle() | Returns first row as object/array | $user = $pdo->fetchSingle("SELECT * FROM users WHERE id = ?", [1]); | | fetchColumnDefault() | Returns column with type inference | $email = $pdo->fetchColumnDefault("SELECT email FROM users LIMIT 1"); | pdo v2.0 extended features

$stmt = $pdo->prepare("SELECT * FROM users WHERE id = :id AND status = :status"); $stmt->execute([':id' => 5, ':status' => 'active']); fetchScalar("SELECT COUNT(*) FROM users")