diff options
Diffstat (limited to 'docs/database.txt')
-rw-r--r-- | docs/database.txt | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/docs/database.txt b/docs/database.txt index e80a4940785d..e893b41032ab 100644 --- a/docs/database.txt +++ b/docs/database.txt @@ -19,10 +19,9 @@ To make a read query, something like this usually suffices: $dbr = wfGetDB( DB_SLAVE ); $res = $dbr->select( /* ...see docs... */ ); -while ( $row = $dbr->fetchObject( $res ) ) { +foreach ( $res as $row ) { ... } -$dbr->freeResult( $res ); Note the assignment operator in the while condition. |