Guest User

Untitled

a guest
Apr 23rd, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.67 KB | None | 0 0
  1.  
  2. //changelogs.php
  3.  <?php include("loop.php"); ?>
  4. <?php
  5. $loop = new loop();
  6.  
  7. ?>
  8.  
  9.  
  10. // loop.php
  11. <?php
  12. class db {
  13. /*** mysql hostname ***/
  14. var $hostname = 'localhost';
  15. /*** mysql username ***/
  16. var $username = 'root';
  17. /*** mysql password ***/
  18. var $password = '';
  19. var $connected = false;
  20. function dbh() {
  21.    
  22.    $dbh = new PDO("mysql:host=$this->hostname;dbname=legiontd", $this->username, $this->password);
  23.     /*** echo a message saying we have connected ***/
  24.    $this->connected = true;
  25.  } 
  26. }
  27.  
  28. class loop {
  29.     var $loop;
  30.     function get_loop($query){
  31.         $this->loop = new db();
  32.         $this->loop->dbh();
  33.         if ($this->loop->connected){
  34.             echo "hi";
  35.         }
  36.     }
  37. }
  38. ?>
Add Comment
Please, Sign In to add comment