Bonjour à tous,

J'essaye de faire un update préparé, lors de l'execute j'ai bien "true" mais en base aucune modification, voici le code utilisé :

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
$sql = "UPDATE ".$this->uniqueString."
				   SET tpa_picture_1_reference = ?,
				   	   tpa_picture_2_reference = ?,
				   	   tpa_picture_3_reference = ?,
				   	   tpa_picture_4_reference = ?,
				   	   tpa_picture_5_reference = ?
				   WHERE tpa_id = ?
				     AND tpa_ref_agence = ?
				     AND tpa_ref_ads = ?";
 
			$stmt = $this->dbh->prepare($sql);
 
	        $stmt->bindParam(1, $tpa_picture_1_reference);
			$stmt->bindParam(2, $tpa_picture_2_reference);
			$stmt->bindParam(3, $tpa_picture_3_reference);
			$stmt->bindParam(4, $tpa_picture_4_reference);
			$stmt->bindParam(5, $tpa_picture_5_reference);
			$stmt->bindParam(6, $tpa_id);
			$stmt->bindParam(7, $tpa_ref_agence);
			$stmt->bindParam(8, $tpa_ref_ads);
 
if(!$stmt->execute())
						echo "Erreur  : ".print_r($stmt->errorinfo())."\r\n";
Pour info certaines variables peuvent être null (je pense que PDO sait gérer ça...)

Merci pour votre aide car je suis vraiment bloqué... et suis pas super callé sur PDO.