Skip to content

Commit

Permalink
ext/pdo: Add FETCH_INTO setting via setAttribute "hack"
Browse files Browse the repository at this point in the history
  • Loading branch information
Girgias committed Jan 15, 2025
1 parent dfcac15 commit abfa377
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions ext/pdo/tests/bug_38253.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ $stmt = $pdo->prepare ("SELECT * FROM test38253");
$stmt->execute();
var_dump($stmt->fetchAll());

$pdo->setAttribute (PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_INTO);
$stmt = $pdo->prepare ("SELECT * FROM test38253");
$stmt->execute();
var_dump($stmt->fetchAll());

?>
--CLEAN--
<?php
Expand All @@ -47,3 +52,9 @@ Warning: PDOStatement::fetchAll(): SQLSTATE[HY000]: General error: No fetch func
Warning: PDOStatement::fetchAll(): SQLSTATE[HY000]: General error%s on line %d
array(0) {
}

Warning: PDOStatement::fetchAll(): SQLSTATE[HY000]: General error: No fetch-into object specified. in %s on line %d

Warning: PDOStatement::fetchAll(): SQLSTATE[HY000]: General error%s on line %d
array(0) {
}

0 comments on commit abfa377

Please sign in to comment.