Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- //Global Connection Settings
- $host = HIDDEN
- $username = HIDDEN
- $password = HIDDEN
- $dbname = HIDDEN
- //Function Fetch_URLs
- function count_topics(){
- global $host, $username, $password, $dbname, $table;
- //Open MySQL Connection
- $connection = mysql_connect($host, $username, $password);
- if (!$connection) {
- die("Connection failed" . mysql_error());
- }
- else {
- //Fetch URLs
- mysql_select_db($dbname, $connection);
- $result = mysql_query("SELECT * FROM phpbb_topics;");
- while ($row = mysql_fetch_array($result)) {
- if ($row["forum_id"] <> 17) { // Forum ID 17 = Playground
- $i++;
- }
- }
- $result = "Topics: " . $i;
- //Close MySQL Connection
- mysql_close($connection);
- }
- }
- return $result;
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement