Guest User

Untitled

a guest
Aug 13th, 2016
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. <?php
  2.  
  3. class database
  4. {
  5.  
  6. protected $DB = null;
  7.  
  8. function __construct()
  9. {
  10. $servername = "127.0.0.1";
  11. $username = "root";
  12. $password = "";
  13. $dbname = "support";
  14.  
  15. $this->DB = new mysqli($servername, $username, $password, $dbname);
  16. if($this->DB->connect_error)
  17. {
  18. die("Connection failed! :( " . $connection>connect_error);
  19. }
  20. }
  21.  
  22. function getConnection()
  23. {
  24. return $this->DB;
  25. }
  26. }
  27.  
  28. ?>
Add Comment
Please, Sign In to add comment