Advertisement
Guest User

Untitled

a guest
May 26th, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. <?php
  2. //Global Connection Settings
  3. $host = HIDDEN
  4. $username = HIDDEN
  5. $password = HIDDEN
  6. $dbname = HIDDEN
  7.  
  8. //Function Fetch_URLs
  9. function count_topics(){
  10. global $host, $username, $password, $dbname, $table;
  11. //Open MySQL Connection
  12. $connection = mysql_connect($host, $username, $password);
  13. if (!$connection) {
  14. die("Connection failed" . mysql_error());
  15. }
  16. else {
  17. //Fetch URLs
  18. mysql_select_db($dbname, $connection);
  19. $result = mysql_query("SELECT * FROM phpbb_topics;");
  20. while ($row = mysql_fetch_array($result)) {
  21. if ($row["forum_id"] <> 17) { // Forum ID 17 = Playground
  22. $i++;
  23. }
  24. }
  25. $result = "Topics: " . $i;
  26. //Close MySQL Connection
  27. mysql_close($connection);
  28. }
  29. }
  30. return $result;
  31. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement