problème d affichage du résultat d une requête sql
bonsoir
je veux afficher les résultats d une requête sql dans des input et sa marche mais le problème est que si la valeur récupéré contient un espace, que le 1er mot est affiché ou b1 il m ajout une \ a la fin du champ t je ne comprend pas pkoi
Code:
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
| <?php
$BD_serveur = "localhost";
$BD_utilisateur = "root";
$BD_motDePasse = "";
$BD_base = "immo";
@mysql_pconnect($BD_serveur, $BD_utilisateur, $BD_motDePasse)
or die("Impossible de se connecter au serveur de bases de données.");
@mysql_select_db($BD_base)
or die("Impossible de se connecter à la base de données.");
$sql2 = "SELECT * FROM membre WHERE ID_MEMBRE='".$_GET['q']."'"; // requéte SQL
$req2 = mysql_query($sql2) or die('<u>Probleme SQL</u> : '.$sql2.'<br>'.mysql_error());
echo '<table width="335" border="0" align="center">';
while($row = mysql_fetch_array($req2)){
echo'
<tr>
<td width="109" height="37" scope="row">Nom</td>
<td width="210"><input name="nom" id="nom" type="text" value='.$row['NOM'].'/></td>
</tr>
<tr>
<td scope="row">Prenom</td>
<td><input name="prenom" id="prenom" type="text" value='.$row['PRENOM'].'/></td>
</tr>
<tr>
<td scope="row">CIN</td>
<td><input name="cin" id="cin" type="text" value='.$row['CIN'].' /></td>
</tr>
<tr>
<td scope="row">Adresse</td>
<td><textarea name="adresse" id="adresse">'.$row['ADRESSE'].'</textarea></td>
</tr>
<tr>
<td scope="row">statut</td>
<td>
<select name="statut" id="statut">
<option value="agent">Agent</option>
<option value="supperviseur">supperviseur</option>
</select>
</td>
</tr>
<tr>
<td scope="row">Tél</td>
<td><input name="tel" type="text" id="tel" value='.$row['TEL'].'/></td>
</tr>
';
}
echo '</table>';
?> |