Bonjour,
je n'arrive pas à updater une variable que je déclare au préalable.
les lignes de code échappées par // ne marchent pas non plus.
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
24
25
26
27 <?php ini_set('display_errors', 1); ini_set('display_startup_errors', 1); error_reporting(E_ALL); session_start(); // connexion a la bdd require_once 'config.php'; /* Initialisation de la variable du message de réponse*/ $err_inscription= null; $avatar= "/avatars/0001.png"; $pdostat = $bdd->prepare('UPDATE membres SET avatar = :avatar WHERE pseudo = :yves'); $pdostat->bindValue(':avatar', $avatar, PDO::PARAM_STR); //$pdostat->execute(); $pdostat->execute(array( 'avatar' => $avatar)); //if ($row = $pdostat->fetch(PDO::FETCH_ASSOC)) { //$_SESSION['avatar'] == $row['avatar']; $_SESSION['avatar'] == $avatar; header('page_test.html'); exit; //} //else { //$err_inscription[] = 'PROBLEME AVEC AVATAR'; //} ?>
Invalid parameter number: number of bound variables does not match number of tokens in C:\wamp64\www\register_av0001.php on line 15
Partager