Created
September 9, 2010 11:31
-
-
Save anonymous/571753 to your computer and use it in GitHub Desktop.
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 | |
class db{ | |
public function connect(){ | |
global $dbhost,$dbname,$dbuser,$dbpassword; | |
$mysqli = new mysqli($dbhost, $dbuser, $dbpassword, $dbname); | |
/* check connection */ | |
if (mysqli_connect_errno()) { | |
printf("Connect failed: %s\n", mysqli_connect_error()); | |
exit(); | |
} | |
} | |
public function close(){ | |
$mysqli->close(); | |
} | |
} /*** end of class ***/ | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment