Bonjour, J'ai appris bcps sur les affichages, mais cependant je bloque pour faire une sorte de filtre sélection pour chaque champ. càd pourvoir faire des filtre comme sur excel pour chaque champs :

voici les champs que souhaite pouvoir filtrer

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
echo '<tr>';
        echo '<td bgcolor="#CCCCCC">'.$row['prenom'].'</td>';
        echo '<td bgcolor="#CCCCCC">'.$row['nom'].'</td>';
        echo '<td bgcolor="#CCCCCC">'.$row['titre'].'</td>';
		echo '<td bgcolor="#CCCCCC">'.$row['phone'].'</td>';
		echo '<td bgcolor="#CCCCCC">'.$row['email'].'</td>';
		echo '<td bgcolor="#CCCCCC">'.$row['no'].'</td>';
		echo '<td bgcolor="#CCCCCC">'.$row['cp'].'</td>';
		//echo '<td bgcolor="#CCCCCC">'.$row['calcul'];
		echo '<td';


Ci-dessous mon php qui fonctionne très bien


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
75
<html>
 
<head>
 
<title>Supprimer</title>
<link href="css/style2.css" rel="stylesheet" type="text/css">
 
</head>
 
<body>
 
  <?php
 
$host = 'localhost';
$user = 'root';
$pass = '';
$db = 'import';
 
 
$link = mysql_connect ($host,$user,$pass) or die ('Erreur : '.mysql_error() );
mysql_select_db($db) or die ('Erreur :'.mysql_error());
 
 
$select = 'SELECT prenom,nom,titre,phone,email,no,cp FROM tfi2003_contacts ';
$select = 'SELECT prenom,nom,titre,phone,email,no,cp,(cp-no) AS calcul FROM tfi2003_contacts ';
$result = mysql_query($select,$link) or die ('Erreur : '.mysql_error() );
$total = mysql_num_rows($result);
 
 
// si on a récupéré un résultat on l'affiche.
if($total) {
    // début du tableau
    echo '<table bgcolor="#FFFFFF">'."\n";
        // première ligne on affiche les titres prénom et surnom dans 2 colonnes
        echo '<tr>';
        echo '<td bgcolor="#669999"><b><u>Prénom</u></b></td>';
        echo '<td bgcolor="#669999"><b><u>nom</u></b></td>';
		echo '<td bgcolor="#669999"><b><u>titre</u></b></td>';
        echo '<td bgcolor="#669999"><b><u>phone</u></b></td>';
		echo '<td bgcolor="#669999"><b><u>email</u></b></td>';
		echo '<td bgcolor="#669999"><b><u>no</u></b></td>';
		echo '<td bgcolor="#669999"><b><u>cp</u></b></td>';
		echo '<td bgcolor="#669999"><b><u>calcul</u></b></td>';
 
		echo '</tr>'."\n";
    // lecture et affichage des résultats sur 2 colonnes, 1 résultat par ligne.    
    while($row = mysql_fetch_array($result)) {
        echo '<tr>';
        echo '<td bgcolor="#CCCCCC">'.$row['prenom'].'</td>';
        echo '<td bgcolor="#CCCCCC">'.$row['nom'].'</td>';
        echo '<td bgcolor="#CCCCCC">'.$row['titre'].'</td>';
		echo '<td bgcolor="#CCCCCC">'.$row['phone'].'</td>';
		echo '<td bgcolor="#CCCCCC">'.$row['email'].'</td>';
		echo '<td bgcolor="#CCCCCC">'.$row['no'].'</td>';
		echo '<td bgcolor="#CCCCCC">'.$row['cp'].'</td>';
		//echo '<td bgcolor="#CCCCCC">'.$row['calcul'];
		echo '<td'; 
		if($row['calcul']>=50 && $row['calcul']<=100){ echo ' bgcolor="#ffcc66"'; } else { echo ' bgcolor="#CCCCCC"'; }
		echo'>'.$row['calcul'].'</td>';
 
		echo '</tr>'."\n";
    }
    echo '</table>'."\n";
    // fin du tableau.
}
else echo 'Pas d\'enregistrements dans cette table...';
 
// on libère le résultat
mysql_free_result($result);
 
?>
 
</body>
 
</html>