Index: trunk/tools/WikipediaStatistics/LocalSettings.php |
— | — | @@ -0,0 +1,8 @@ |
| 2 | +<?php |
| 3 | + |
| 4 | +$localSettings = array( |
| 5 | + 'host' => null, |
| 6 | + 'dbname' => null, |
| 7 | + 'username' => null, |
| 8 | + 'password' => null, |
| 9 | +); |
\ No newline at end of file |
Index: trunk/tools/WikipediaStatistics/index.php |
— | — | @@ -5,9 +5,19 @@ |
6 | 6 | <body> |
7 | 7 | <h1>Wikipedia Statistics</h1> |
8 | 8 | <?php |
9 | | - /* |
10 | | - * Wikipedia Statistics |
11 | | - */ |
12 | 9 | |
| 10 | + require_once 'LocalSettings.php'; |
| 11 | + |
| 12 | + $dbh = new PDO( |
| 13 | + 'mysql:host=' . $localSettings['host'] . ';' . |
| 14 | + 'dbname=' . $localSettings['dbname'], |
| 15 | + $localSettings['username'], |
| 16 | + $localSettings['password'] |
| 17 | + ); |
| 18 | + foreach( $dbh->query( 'SELECT * FROM user_groups' ) as $row ){ |
| 19 | + echo implode( ' / ', $row ) . '<br />'; |
| 20 | + } |
| 21 | + $dbh = null; |
| 22 | + |
13 | 23 | ?> |
14 | 24 | </body> |
\ No newline at end of file |