Guest User

Untitled

a guest
Dec 7th, 2017
71
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. class DB {
  3. var $hostname;
  4. var $username;
  5. var $password;
  6. var $database;
  7.  
  8. function __Construct() {
  9. $this->hostname='localhost';
  10. $this->username='root';
  11. $this->password='';
  12. $this->database='new';
  13. }
  14.  
  15. function _connect()
  16. {
  17. $conn = mysql_connect ($this->hostname , $this->username , $this->password );
  18. $db=mysql_select_db ($this->dbname);
  19. }
  20.  
  21. if($conn && $db){
  22. return true;
  23. }
  24. else
  25. {
  26. return false;
  27. }
  28. }
  29. ?>
Add Comment
Please, Sign In to add comment