Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class Database{
- public static $connection;
- private static $dbtype = "mysql";
- private static $dbname = "crud_php";
- private static $host = "localhost";
- private static $user = "root";
- private static $pass = "";
- public function getconnection(){
- if(!self::$connection){
- self::$connection = new PDO("$dbase:db_name=$dbname;host=$host", $user, $pass);
- }
- return self::$connection;
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement