Created
June 24, 2017 16:49
-
-
Save NitishDiwakar/e87223cbd30a1ff4403da47c7d871a80 to your computer and use it in GitHub Desktop.
Register and login with php & mysqli using oop
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// filename include/connection.php | |
define('DB_SERVER', 'localhost'); | |
define('DB_USERNAME', 'root'); | |
define('DB_PASSWORD', ''); | |
define('DB_DATABASE', 'oop'); | |
function db () { | |
static $conn; | |
if ($conn===NULL){ | |
$conn = new mysqli(DB_SERVER, DB_USERNAME, DB_PASSWORD, DB_DATABASE); | |
} | |
return $conn; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment