Update outdated API documentation... (is this file even used any more?)
authorSam Reed <reedy@users.mediawiki.org>
Sat, 7 Aug 2010 13:57:15 +0000 (13:57 +0000)
committerSam Reed <reedy@users.mediawiki.org>
Sat, 7 Aug 2010 13:57:15 +0000 (13:57 +0000)
docs/database.txt

index e80a494..e893b41 100644 (file)
@@ -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.