Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class connex {
- public static $bdd;
- const USERNAME="root";
- const PASSWORD="root";
- const HOST="localhost";
- const DB="forum";
- public function connexion() {
- try {
- $username = self::USERNAME;
- $password = self::PASSWORD;
- $host = self::HOST;
- $db = self::DB;
- $bdd = new PDO("mysql:dbname=$db;host=$host", $username, $password);
- }catch (PDOException $e){
- print "Erreur, " . $e->getMessage() . "<br />";
- die();
- }
- return true;
- }
- public function deconnexion() {
- $bdd = null;
- return true;
- }
Add Comment
Please, Sign In to add comment