Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class db{
- public $host = 'localhost';
- public $username = 'root';
- public $password = '';
- public $dbname = 'oop';
- public function __construct(){
- $con = new mysqli($this->host,$this->username,$this->password,$this->dbname);
- }
- }
- if(isset($con)){
- echo "<center><h1 style='color:green;'>Db is conected</h1></center>";
- }else{
- echo "<center><h1 style='color:red;'>Db is not conected</h1></center>";
- }
- $obj = new db;
- ?>
Add Comment
Please, Sign In to add comment