Thread:Project:Support desk/Mediawiki equivalent to mysql/mysqli fetch array?/reply (3)

The most mediawiki-ish way of accomplishing that

The $dbr->select method, returns an instance of the ResultWrapper class. This can be used in a foreach loop to get every row you fetched from the database. The row's are retuned as objects with each column as a property. Alternatively (This is almost never used in MediaWiki code), you can call $result->fetchRow, which will return a row from your database query as an associative array. Every time you call fetchRow it returns the next row from the database query, so you can simply call fetchRow in a loop.