| 12
 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
 
 | //-----------------Affiche les données-----------------------------------//
function Affiche_region($reqSelect)
{
	$connect = mysql_connect("localhost","root",'') or die ("Erreur de connexion au serveur.");
	mysql_select_db("bd_acep",$connect) or die ("Erreur de connexion à la base de données.");
 
	$result = mysql_query($reqSelect) or exit(mysql_error());
	if($result = mysql_query($reqSelect)){
 
		echo '<table align="center" border="1"><caption>Données enregistrées.</caption><tr>';
		for ($i= 0; $i< mysql_num_fields($result); $i++) {
    		echo '<th>';
    		echo mysql_field_name($result, $i);
    		echo '</th>';
		}
 
		echo '</tr>';
		while ($row = mysql_fetch_row($result)) {
    		echo '<tr>';
    		for ($j = 0; $j < count($row); $j++) {
        		echo '<td>';
        		echo ($row[$j] == NULL) ? '<i>NULL</i>' : $row[$j];
        		echo '</td>';
    		}
    		echo '</tr>';
		}
	}
	mysql_close();
}
 
Grâce à ce code, j'ai les résultats d'une requête sous forme de tableau comme Easyphp affiche les données. Mais je souhaite ajouter un button d'option à chaque ligne. Un peu de ce type:
 
<form method="POST">
    <input type="radio" name="mon_champ" value="Option 1"/>Option 1<br/>
    <input type="radio" name="mon_champ" value="Option 2"/>Option 2<br/>
    <input type="radio" name="mon_champ" value="Option 3"/>Option 3<br/>
    <input type="submit" value="OK"/>
</form> | 
Partager