Skip to content

Commit 581589d

Browse files
authored
constants.fetch-modes.xml Fix the call sequence (#5361)
Thank you. Sorry, I don't know why it hasn't been merged yet.
1 parent f7e68a1 commit 581589d

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

reference/pdo/constants.fetch-modes.xml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1061,6 +1061,7 @@ while ($stmt->fetch(\PDO::FETCH_BOUND)) {
10611061
<programlisting role="php">
10621062
<![CDATA[
10631063
<?php
1064+
10641065
class TestEntity
10651066
{
10661067
public $userid;
@@ -1073,10 +1074,12 @@ class TestEntity
10731074
}
10741075
10751076
$obj = new TestEntity();
1076-
$stmt->setFetchMode(\PDO::FETCH_INTO, $obj);
10771077
10781078
$stmt = $db->query("SELECT userid, name, country, referred_by_userid FROM users");
1079+
1080+
$stmt->setFetchMode(\PDO::FETCH_INTO, $obj);
10791081
$result = $stmt->fetch();
1082+
10801083
var_dump($result);
10811084
]]>
10821085
</programlisting>

0 commit comments

Comments
 (0)