Bonjour à vous tous
S'il vous plaît voilà mon code php. Je ne parviens pas à inserer dans la BD et pourtant il me retourne le message"Inserer avec succes" cependant dans la BD rien.
Merci de vos differentes suggestion.
Bonne journée à tous.
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
62
63
64
65
66
67
68
69
70
71
72
73
74 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "<a href="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" target="_blank">http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd</a>"> <html xmlns="<a href="http://www.w3.org/1999/xhtml" target="_blank">http://www.w3.org/1999/xhtml</a>" xml:lang="fr" lang="fr"> <head> <title>Notre : echo</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> </head> <body> <p> <?php mysql_connect("localhost", "root", "") or die ("impossible de se connecter"); // Connexion à MySQL mysql_select_db("bdimmo") or die ("impossible de trouver la base de donnée"); // Sélection de la base mateo21 if (isset($_POST['CodeImmo'])and isset($_POST['choix'])and isset($_POST['Type_de_bien'])and isset($_POST['Ville']) ) { $CodeImmo=htmlentities($_POST['CodeImmo']);$choix=htmlentities($_POST['choix']);$Type_de_bien=htmlentities($_POST['Type_de_bien']); $Ville=htmlentities($_POST['Ville']); mysql_query("INSERT INTO immobilisation (id,CodeImmo,choix,Type_de_bien, Ville) values('','" . $CodeImmo ."','" . $choix ."','" . $Type_de_bien ."', '" . $Ville ."')"); echo "Enregistrer avec succes"; mysql_close(); } else { echo "Désolé, c'est tres fort"; } ?> </p> <form action="test.php" method="post"> <p>Code Immobilier <input type="text" name="CodeImmo" size="10" dir="rtl" tabindex="0"> <label><input type="radio" value="V" checked name="choix" tabindex="1">A Vendre</label> <label><input type="radio" name="choix" value="L" tabindex="2"> A Louer</label></br> <p>Type de bien <select size="1" name="Type_de_bien" style="padding: 5" tabindex="3"> <option selected>Appartement</option> <option>Maison</option> <option>Demeure de prestige</option> <option>Fonds de Commerce</option> <option>Parking</option> <option>Immeuble</option> <option>Domaine Agricole</option> <option>Domaine forestier</option> <option>Terrain</option> <option>Bureau local</option> <option>Bureau professionnel</option> <option>Boutique</option> <option>Local Industriel</option> </select></p> <p>Ville <select size="1" name="Ville" tabindex="4"> <option selected>Douala</option> <option>Yaoundé</option> <option>Bafoussam</option> <option>Garoua</option> <option>Maroua</option> <option>Ebolowa</option> <option>Kribi</option> <option>Ngaoundéré</option> <option>Nkongsamba</option> <option>Buea</option> <option>Limbe</option> <option>Bamenda</option> <option>Bertoua</option> </select></p> <input type="submit" value="Ajouter" tabindex="25" /> </p> </form> </body> </html>
Partager