Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class Database
- {
- protected $db_host = "localhost";
- protected $db_user = "root2"; //здесь специально произведена ошибка. Верное выражение - root в данном случае.
- protected $db_pass = "1111";
- protected $db_name = "program";
- protected $mysqli;
- public function connect()
- {
- try
- {
- $this->mysqli = new mysqli($this->db_host, $this->db_user, $this->db_pass, $this->db_name);
- }
- catch(Exception $expection)
- {
- echo 'Connection error: ' . $expection->getMessage();
- }
- }
- }
- $database = new Database;
- $database->connect();
- ?>
Add Comment
Please, Sign In to add comment