Bonjour j ai cree une base ave cune table et plusieurs champs j ai reussi a creer un script a l aide d un tuto qui me permet d inserez dees données dans ma base voici les deux fichiers php qui m ont permis de le faire, je souhaite maintenant creer un fichier php qui me pemet grace a de slenus deroulant de selectionner des champs dans ma table et de le smodifier mais je ne sais ps par ou commencer.

Merci de votre aide

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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional //EN"
"http://www.w3.org/TR/xhtmll/DTD/xhtmll-transitional.dtd">
<html Xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Mailing</title>
<link href="formulaire.css" rel="stylesheet" type="text/css" />
</head>
<form name="insertion" action="insertion2.php" method="POST">
  <table border="0" align="center" cellspacing="2" cellpadding="2">
    <tr align="center">
      <td>label</td>
      <td><input type="text" name="label"></td>
    </tr>
    <tr align="center">
      <td>reference</td>
      <td><input type="text" name="reference"></td>
    </tr>
    <tr align="center">
      <td>artiste</td>
      <td><input type="text" name="artiste"></td>
    </tr>
    <tr align="center">
      <td>album</td>
      <td><input type="text" name="album"></td>
    </tr>
    <tr align="center">
      <td>format</td>
      <td><input type="text" name="format"></td>
    </tr>
 
<tr align="center">
      <td>dispo</td>
      <td><input type="text" name="dispo"></td>
    </tr>
 
<tr align="center">
      <td>tarifs</td>
      <td><input type="text" name="tarifs"></td>
    </tr>
 
<tr align="center">
      <td>etat</td>
      <td><input type="text" name="etat"></td>
    </tr>    
 
<tr align="center">
      <td>liensweb</td>
      <td><input type="text" name="liensweb"></td>
    </tr>
 
<tr align="center">
      <td>informations</td>
      <td><input type="text" name="informations"></td>
    </tr>
 
<tr align="center">
      <td colspan="2"><input type="submit" value="insérer"></td>
<tr align="center">
<td colspan="2"><input type="reset" value="Recommencer" /></td>
    </tr>
  </table>
</form>
</body>
 
</html>
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
   <?php
  //connection au serveur
  $cnx = mysql_connect( "localhost", "root", "" ) ;
 
  //sélection de la base de données:
  $db  = mysql_select_db( "musik" ) ;
 
  //récupération des valeurs des champs:
  //label:
  $label     = $_POST["label"] ;
  //reference:
  $reference = $_POST["reference"] ;
  //artiste:
  $artiste = $_POST["artiste"] ;
  //album:
  $album      = $_POST["album"] ;
  //format:
  $format       = $_POST["format"] ;
  //dispo:
  $dispo       = $_POST["dispo"] ;
  //tarifs:
  $tarifs       = $_POST["tarifs"] ;
  //etat:
  $etat       = $_POST["etat"] ;
  //liensweb:
  $liensweb       = $_POST["liensweb"] ;
  //informations:
  $informations       = $_POST["informations"] ;
 
  //création de la requête SQL:
  $sql = "INSERT  INTO handsandarms (label, reference, artiste, album, format, dispo, tarifs, etat, liensweb, informations)
            VALUES ( '$label', '$reference', '$artiste','$album', '$format', '$dispo' , '$tarifs', '$etat', '$liensweb', '$informations') " ;
 
  //exécution de la requête SQL:
  $requete = mysql_query($sql, $cnx) or die( mysql_error() ) ;
 
  //affichage des résultats, pour savoir si l'insertion a marchée:
  if($requete)
  {
    echo("L'insertion a été correctement effectuée") ;
  }
  else
  {
    echo("L'insertion à échouée") ;
  }
?>