bonjour je suis débutant en php en faite j'ai un tableau dynamique en php a chaque fois que j'insère un produit il m'affiche son ID son nom et le nombre de composant du produit . ( je travail avec mysql comme base de données ) le problème c'est que je veux dans la dernière colonne mettre des case a cocher pour chaque ligne une case a cocher afin de sélectionner le produit correspondant et après je dois ajouter un bouton qui sélectionne uniquement pour les lignes dont la case est cochée. et affiches les composant de ces produits . voila le code .
merci .

Code php : 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
  <?php
 
	$dbhost="localhost";
	$dblogin="root";
	$dbpassword="";
	$dbname="gscop";
 
	mysql_connect($dbhost,$dblogin,$dbpassword) or die("connexion au
 serveur impossible");
	mysql_select_db($dbname) or die("base de donn&eacute;e inexistante");
 
	$req= "SELECT `id_produit`,`nom_produit`,`nbr_composant` FROM
 `produits` ORDER BY `id_produit`";  
 
	$result=mysql_query($req);
	if($row=mysql_fetch_array($result))
	{
 
		echo("<table width=300 height=280 border=0 cellpadding=0
 cellspacing=0 ><tbody><tr><td height=180 align=center valign=top><table 			border=1 cellpadding=0 cellspacing=0 >");
		echo("    <tr>   <th>ID</th> <th>Libelle</th> <th>Nombre de
 composant</th> <th>selection</th>  </tr>");
 
		  	echo '<tr>';
			echo'<td><b>'.$row[0].'</a>*</b></td>'; 
			echo'<td><b>'.$row[1].'</a>*</b></td>'; 
			echo'<td><b>'.$row[2].'</a>*</b></td>'; 
			echo'<td><b><input type="checkbox" value="1" name="pr"='.$row[0].'&NomProduit='.$row[1].'">'.$row[3].'</a>*</b></td>'; 
			echo'</tr>';  
 
 
 
 
		 while ($row=mysql_fetch_array($result)) 
		 {
		  	echo '<tr>';
			echo'<td><b>'.$row[0].'</a>*</b></td>'; 
			echo'<td><b>'.$row[1].'</a>*</b></td>'; 
			echo'<td><b>'.$row[2].'</a>*</b></td>'; 
			echo'<td><b><input type="checkbox"  value="1" name="pr"='.$row[0].'&NomProduit='.$row[1].'">'.$row[3].'</a>*</b></td>'; 
			echo'</tr>'; 
 
		 } 
 
 	}
 	else
 	{
		echo("<table width=300 height=280 border=0 cellpadding=0
 cellspacing=0 color:white ><tbody><tr><td height=180 align=center
 valign=top><table border=0 cellpadding=0 cellspacing=0>");
 		echo ("<br><br> <center><b>aucun produit n'est disponible  ");
 
 	}
	mysql_close();
 
	?>
       </p>
       <p align="center">
 
         <input name="button" size="30" type="submit" class="input2" value="valider" onClick="">
       </p>
     </div>
</table>
</td>
</tr>
</tbody></table>