Bonjour a tous,
je n'arrive pas a récupérer les données de ma requête préparé pour les afficher dans le tpl.

erreur retourné :

Fatal error: Cannot use object of type PDOStatement as array in

code :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
 
$clients = $connexion -> prepare("SELECT nom, prenom, raison_social, adresse, code_postal, ville, contact, telephone, fax, email, mode_paiement, numero_comptable, commentaire, regularite FROM clients WHERE id=:id ");
			$clients -> BindValue("id", $_GET['id']);
			$clients -> execute();
			$clients -> fetch();
 
			// Assign les variable
			$oSmarty->assign('nom', $clients['nom']);
			$oSmarty->assign('prenom', $clients['prenom']);
			$oSmarty->assign('raison_social', $clients['raison_social']);
			$oSmarty->assign('adresse', $clients['adresse']);
			$oSmarty->assign('code_postal', $clients['code_postal']);
			$oSmarty->assign('ville', $clients['ville']);
			$oSmarty->assign('contact', $clients['contact']);
			$oSmarty->assign('telephone', $clients['telephone']);
			$oSmarty->assign('fax', $clients['fax']);
			$oSmarty->assign('email', $clients['email']);
			$oSmarty->assign('mode_paiement', $clients['mode_paiement']);
			$oSmarty->assign('numero_comptable', $clients['numero_comptable']);
			$oSmarty->assign('commentaire', $clients['commentaire']);
			$oSmarty->assign('regularite', $clients['regularite']);
 
			$oSmarty->display('clientele.tpl');