Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- error_reporting(E_ALL);
- class connectoDB
- {
- public $host = 'localhost';
- public $user = 'root';
- public $pswd = 'rootPS';
- public $base = 'lr';
- public $connect; //the variable I will use to connect with the database
- function todb()
- {
- if ($this->connect = (mysqli_connect($this->host, $this->user, $this->pswd, $this->base)) == true)
- {
- echo "It works!!";
- }
- else
- {
- echo "No connection";
- }
- }
- }
- $connect2db = new connectoDB;
- print $connect2db->todb();
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement