Advertisement
Guest User

Untitled

a guest
Jun 26th, 2017
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.73 KB | None | 0 0
  1. //erreur
  2.  
  3. Notice: Undefined variable: db in C:\wamp\www\touchyourmusic.free.fr\blue1ce\jbtools.php on line 15
  4. Fatal error: Call to a member function query() on a non-object in C:\wamp\www\touchyourmusic.free.fr\blue1ce\jbtools.php on line 15
  5.  
  6. //mysqlconnect.php
  7.  
  8. try
  9. {
  10.     $db = new PDO('mysql:host=localhost;dbname=blue1ce', 'root', '');
  11. }
  12. catch (Exception $e)
  13. {
  14.         die('Error : ' . $e->getMessage());
  15. }
  16.  
  17. //jbtools.php
  18.  
  19. include("scripts/mysqlconnect.php");
  20.  
  21. function versionfetch($tool)
  22. {
  23.     global $db; // et comme ca ?
  24.     $table = $db->query('SELECT * FROM jbtoolsversions'); // <--- LIGNE 15
  25.     do{
  26.         $data = $table->fetch();
  27.     } while($data['tool'] != $tool);
  28.     $table->closeCursor();
  29.    
  30.     return $data['version'];
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement