[Mediawiki-l] SQL Query Question ..

KlinT klint at klintcentral.net
Fri Oct 13 09:51:28 UTC 2006


Hi again,

I think I've found it ...

Here is a sample :

$db = &wfGetDB(DB_SLAVE);
$query = "SELECT * FROM mw_user ORDER BY user_id";
if ($result = $db->doQuery($query)) {
      while ($row = $db->fetchRow($result)) {
         $wgOut->addHTML($row['user_id']." - ".$row['user_name']." -  
".$row['user_real_name']."<br>");
      }
}


Any other tips ?

Le 13 oct. 06 à 11:13, KlinT a écrit :

> Hi all,
>
> Well, I'd like to write a SpecialPage in which I'll list data from a
> MySQL Table.
>
> I'm able to do it if I use an external MySQL database ( not the one
> where the wikidb is ) ... But when I try to query a table in a
> database located on the same MySQL ( the one whet wikidb is ) ... I
> get a php exception ...
>
> So I had a look to the php code inside special pages provided by
> MediaWiki ... And I've found that Special internal functions are
> used ...
>
>
> Please can somebody give me some informations about howto write a
> simple request using $wgXXX functions ?
>
> Pointing me to relevant documentation will be ok ... :D
>
> Best Regards.
> _______________________________________________
> MediaWiki-l mailing list
> MediaWiki-l at Wikimedia.org
> http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
>




More information about the MediaWiki-l mailing list