Guest User

Untitled

a guest
Nov 21st, 2017
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. <?php
  2. class db{
  3. public $host = 'localhost';
  4. public $username = 'root';
  5. public $password = '';
  6. public $dbname = 'oop';
  7.  
  8. public function __construct(){
  9. $con = new mysqli($this->host,$this->username,$this->password,$this->dbname);
  10. }
  11. }
  12. if(isset($con)){
  13. echo "<center><h1 style='color:green;'>Db is conected</h1></center>";
  14. }else{
  15. echo "<center><h1 style='color:red;'>Db is not conected</h1></center>";
  16. }
  17. $obj = new db;
  18. ?>
Add Comment
Please, Sign In to add comment