Bonjour
j'ai modifier un script et un problème est survenue , la variable var_dump($datat); me retourne ceci
Voici mon code :array(8) { [0]=> string(2) "66" ["id_sea"]=> string(2) "66" [1]=> string(1) "3" ["id_cat"]=> string(1) "3" [2]=> string(6) "KM max" ["sel_nom"]=> string(6) "KM max" [3]=> string(12) "Kilométrage" ["champ"]=> string(12) "Kilométrage" }
Année-Modèle :
bool(false) <-------------- c'est ici que la variable est vide !!!
Energie :
array(8) { [0]=> string(3) "190" ["id_sea"]=> string(3) "190" [1]=> string(1) "2" ["id_cat"]=> string(1) "2" [2]=> string(7) "Energie" ["sel_nom"]=> string(7) "Energie" [3]=> string(7) "Energie" ["champ"]=> string(7) "Energie" }
Boite :
array(8) { [0]=> string(3) "189" ["id_sea"]=> string(3) "189" [1]=> string(1) "2" ["id_cat"]=> string(1) "2" [2]=> string(16) "Boite de vitesse" ["sel_nom"]=> string(16) "Boite de vitesse" [3]=> string(5) "Boite" ["champ"]=> string(5) "Boite" }
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61 <?php function display_noms($array) { foreach ($array as $row) { $id= htmlspecialchars($row['id_for'], ENT_QUOTES); $form_name = "form".$id; if (!empty($_SESSION[$form_name])) { $value = stripslashes(htmlspecialchars($_SESSION[$form_name], ENT_QUOTES)); } else $value = ''; $name = stripslashes(htmlspecialchars($row['nom_for'], ENT_QUOTES)); $uni= stripslashes(htmlspecialchars($row['uni_for'], ENT_QUOTES)); echo '<p class="form_left">'; if (isset($_SESSION['error'][''. $form_name .''])) echo '<span class="error">'; echo '<label for="'. $name .'">'. $name .' :</label>'; if (isset($_SESSION['error'][''. $form_name .''])) echo '</span>'; echo '</p>'; $sqlconnect = "SELECT * FROM search WHERE champ='$name'"; $reqconnect = mysql_query($sqlconnect) or die('Erreur SQL !<br>'.$sql.'<br>'.mysql_error()); $datat = mysql_fetch_array($reqconnect); $rrr = $datat["sel_nom"]; if($rrr == 'Année-Modèle') {$rrr="Année-Modèle min";} var_dump($rrr); ?> <p class="form_right_select"> <label for="<?php echo"$name"; ?>"></label> <select name="<?php echo"$name"; ?>" id="<?php echo"$name"; ?>" class="av_input"> <?php $sqlconnect1 = "SELECT * FROM select_valeurs WHERE sel_nom='$rrr'"; $reqconnect1 = mysql_query($sqlconnect1) or die('Erreur SQL !<br>'.$sql.'<br>'.mysql_error()); while($dataw = mysql_fetch_array($reqconnect1)) { $valeur = $dataw["valeur"]; echo"<option value=\"$valeur\">$valeur</option> ";} ?> </select> <span class="info_form"> </span> </p> <?php /* echo ' <input type="text" id="'. $name .'" class="av_input" name="'. $form_name .'" value="'. $value .'" /> <span class="info_form">'. $uni .''; */ } }
J'ai chercher longtemps d’où le problème pourrait venir mais j'ai pas trouver ... le truc est bizarre ....
Je vous remercie de votre futur aide
Partager