Guest User

Untitled

a guest
Oct 23rd, 2017
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  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. }
Add Comment
Please, Sign In to add comment