Skip to content

Commit abfa377

Browse files
committed
ext/pdo: Add FETCH_INTO setting via setAttribute "hack"
1 parent dfcac15 commit abfa377

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

ext/pdo/tests/bug_38253.phpt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ $stmt = $pdo->prepare ("SELECT * FROM test38253");
2828
$stmt->execute();
2929
var_dump($stmt->fetchAll());
3030

31+
$pdo->setAttribute (PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_INTO);
32+
$stmt = $pdo->prepare ("SELECT * FROM test38253");
33+
$stmt->execute();
34+
var_dump($stmt->fetchAll());
35+
3136
?>
3237
--CLEAN--
3338
<?php
@@ -47,3 +52,9 @@ Warning: PDOStatement::fetchAll(): SQLSTATE[HY000]: General error: No fetch func
4752
Warning: PDOStatement::fetchAll(): SQLSTATE[HY000]: General error%s on line %d
4853
array(0) {
4954
}
55+
56+
Warning: PDOStatement::fetchAll(): SQLSTATE[HY000]: General error: No fetch-into object specified. in %s on line %d
57+
58+
Warning: PDOStatement::fetchAll(): SQLSTATE[HY000]: General error%s on line %d
59+
array(0) {
60+
}

0 commit comments

Comments
 (0)