Advertisement
Guest User

Untitled

a guest
Sep 20th, 2017
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. <?php
  2. class db{
  3. var $username = 'metrots_testuser';
  4. var $password = '420smokeshit';
  5. var $host = 'localhost';
  6. var $database = 'metrots_phptest';
  7. var $cxn_result;
  8.  
  9. //CREATE THE CONSTRUCTOR
  10. /*
  11. function __constructor(){
  12.  
  13. }
  14. */
  15.  
  16. //CREATE A FUNTION TO CONNECT TO THE DB
  17. function dbconnect(){
  18. $this->cxn_result = mysql_connect($this->host, $this->username, $this->password);
  19. if($this->cxn_result){
  20. echo "CONNECTION WAS SUCCESSFUL";
  21. } else {
  22. die('COULD NOT CONNECT'.mysql_error());
  23. }
  24. }
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31. //END OF CLASS
  32. }
  33. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement