requête non reconnu comme objet
Bonjour a tous,
Je fais mes premières heures de vol en PDO :mouarf:
Et voila que je tombe sur le premier bug que je n'arive pas a résoudre si jamais quelqu'un pouvais éclairé mon chemin sa serait sympas :ccool:
Alors voici l'erreur retournée :
Fatal error: Call to a member function fetch() on a non-object in ....
Voici le code concerné :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
|
switch ($page)
{
case '/accueil' :
$titre_p = 'Accueil ';
break;
case '/actualites/'.$_GET['titre'].'' :
$titre = htmlspecialchars($_GET['titre']);
$dbr_titre = $connexion -> query('SELECT * FROM site_actu WHERE url='.$titre.'');
$titre2 = $dbr_titre -> fetch();
$titre_p = $titre2['titre'];
break;
case '/actualites/cat/'.$_GET['url'].'' :
$url = htmlspecialchars($_GET['url']);
$requete_cat_news = 'SELECT nom FROM config_sous_cat WHERE curl='.$url.'';
$dbr_cat_news = $connexion -> query($requete_cat_news);
$cat_news = $dbr_cat_news ;
$titre_p = 'L\'actualité '.$cat_news['nom'].'';
break;
} |