Bonjour a tous,
Je n'arrive pas a trouvé l'erreur que me retourne la console.

erreur : Invalid parameter number: number of bound variables does not match number of tokens

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
24
25
26
27
28
29
30
31
32
33
34
 
	$candidat = $connexion -> prepare("INSERT INTO candidats SET nom=:nom, prenom=:prenom, adresse=:adresse, departement=:departement, email=:email', tel=:tel, date=:date, sit_fam=:sit_fam, age=:age, formation=:formation, experience=:experience, langue=:langue, divers=:divers, cv=:cv, poste=:poste, poste2=:poste2, poste3=:poste3', poste4=:poste4, 1departement=:1departement, 1departement2=:1departement2, 1departement3=:1departement3, 1departement4=:1departement4, 1region=:1region, id_user=:id_user, preavis=:preavis, salaire=:salaire, commentaire=:commentaire, gestion=:gestion, produits=:produits, management=:management, divers_eval=:divers_eval ");
	$candidat -> bindParam('nom', $_POST['nom']);
	$candidat -> bindParam('prenom', $_POST['prenom']);
	$candidat -> bindParam('adresse', $_POST['adresse']);
	$candidat -> bindParam('departement', $_POST['dept'], PDO::PARAM_INT);
	$candidat -> bindParam('email', $_POST['email']);
	$candidat -> bindParam('tel', $_POST['tel'], PDO::PARAM_INT);
	$candidat -> bindParam('date', date('Y,m,d'));
	$candidat -> bindParam('sit_fam', $_POST['sit_fam']);
	$candidat -> bindParam('age', $_POST['jour'], PDO::PARAM_INT);
	$candidat -> bindParam('formation', $_POST['forma']);
	$candidat -> bindParam('experience', $_POST['expe']);
	$candidat -> bindParam('langue', $_POST['langue']);
	$candidat -> bindParam('divers', $_POST['divers']);
	$candidat -> bindParam('cv', $_POST['cv']);
	$candidat -> bindParam('poste', $_POST['poste']);
	$candidat -> bindParam('poste2', $_POST['poste2'], PDO::PARAM_INT);
	$candidat -> bindParam('poste3', $_POST['poste3'], PDO::PARAM_INT);
	$candidat -> bindParam('poste4', $_POST['poste4'], PDO::PARAM_INT);
	$candidat -> bindParam('1departement', $_POST['dept'], PDO::PARAM_INT);
	$candidat -> bindParam('1departement2', $_POST['dept2'], PDO::PARAM_INT);
	$candidat -> bindParam('1departement3', $_POST['dept3'], PDO::PARAM_INT);
	$candidat -> bindParam('1departement4', $_POST['dept4'], PDO::PARAM_INT);
	$candidat -> bindParam('1region', $_POST['region'], PDO::PARAM_INT);
	$candidat -> bindParam('id_user', $_SESSION['admin_id'], PDO::PARAM_INT);
	$candidat -> bindParam('preavis', $_POST['preavis']);
	$candidat -> bindParam('salaire', $_POST['salaire'], PDO::PARAM_INT);
	$candidat -> bindParam('commentaire', $_POST['divers']);
	$candidat -> bindParam('gestion', $_POST['gestion']);
	$candidat -> bindParam('produits', $_POST['produits']);
	$candidat -> bindParam('management', $_POST['management']);
	$candidat -> bindParam('divers_eval', $_POST['com'], PDO::PARAM_INT);
	$candidat -> execute();
Le deuxième soucis concerne l'upload. si quelqu'un voit une erreur sa serait sympas si jamais je trouve la solutions je passe vous informer. concernant l'upload il me dit que l'extenssion du fichier est invalide.

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
 
$nomOrigine = $_FILES['cv']['name'];
	echo $nomOrigine.'/';
	$elementsChemin = pathinfo($nomOrigine);
	echo $elementsChemin.'/';
	$extensionFichier = $elementsChemin['extension'];
	echo $extensionFichier.'/';
	$extensionsAutorisees = array('PDF', 'pdf', 'doc');
				if (!(in_array($extensionFichier, $extensionsAutorisees))) 
					{
   					echo '<div class="notification error png_bg"><div>Le fichier n\'a pas l\'extension attendue, <a href="#">Retour</a></div></div>';
					}
					else
						{
						$repertoireDestination = 'répertoire de destination';
    					$nomDestination = ''.$nombre.'_'.clean_url($article_titre).'.'.$extensionFichier.'';
						move_uploaded_file($_FILES["cv"]["tmp_name"],$repertoireDestination.$nomDestination);
 
						echo '<div class="bo_sign">
							<center>Le candidat à bien été ajouté <a href="#">retour</a></center>
		 				 </div>';
						}