daily pastebin goal
49%
SHARE
TWEET

Untitled

a guest Oct 23rd, 2017 83 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Fatal error: Call to a member function query() on null in /var/www/html/forum/kernel/model.class on line 40
  2.    
  3. class connex {
  4. public static $bdd;
  5. const USERNAME="root";
  6. const PASSWORD="root";
  7. const HOST="localhost";
  8. const DB="forum";
  9. public function connexion() {
  10.      try {
  11.         $username = self::USERNAME;
  12.         $password = self::PASSWORD;
  13.         $host = self::HOST;
  14.         $db = self::DB;
  15.         $bdd = new PDO("mysql:dbname=$db;host=$host", $username, $password);
  16.  
  17.       }catch (PDOException $e){
  18.             print "Erreur, " . $e->getMessage() . "<br />";
  19.             die();
  20.          }
  21.     return true;
  22. }
  23.  
  24. public function deconnexion() {
  25.     $bdd = null;
  26.     return true;
  27.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top