bonjour à tous,j'aimerais rechercher et afficher si un choix a été fait tous les clients qui ont un compte
voici mon code mais ça marche pas.

Code html : 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
<form method="post" action="#" name="form">
    <table class="listcli"><tr><td>Rechercher</td>
    <td>
    <select name="choisir">
    <option value="0">-----Choisir la recherche à effectuer-----</option>
    <option value="1">Clients ayant un compte épargne</option>
    <option value="2">Clients ayant un compte chèque</option>
    <option value="3">Client par le numéro de compte</option>
    <option value="4">Client par le nom ou le prénom</option>
    </select>
    </td>
    <td>
    <input type="text" name="numcompte" disabled="disabled" />
    </td>
    <td>
    <input type="submit" name="rechercher" value="Rechercher" />
    </td>
    </tr>
    </table>
    </form>
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
<?php
if(isset($_POST['rechercher']) && ($_POST['choisir']=="1")){
	include('connexion_base.php');
	$epar="Epargne";
	$cheq="Cheque";
	$sql="select client.nom_clt,client.prenom_clt,compte.num_compte,compte.type_compte,compte.solde_compte from client,compte where
		client.id_clt=compte.id_clt and compte.type_compte='$cheq'";
	    mysql_query($sql) or die('Erreur SQL !'.$sql.'<br />'.mysql_error());
	while($tab=mysql_fetch_assoc($sql)){
		$num=$tab['compte.num_compte'];
		$nom=$tab['client.nom_clt'];
		$prenom=$tab['client.prenom_clt'];
		$type=$tab['compte.type_compte'];
		$solde=$tab['compte.solde_compte'];
		echo"<p><h3>Liste des clients compte épargne</h3></p>";
		echo"<br/>";
		echo"<div class='liste'>";
		echo"<table border='1'>";
		echo"<tr><td width='150' align='center'>Numéro de compte</td><td width='150' align='center'>Nom</td>
		<td width='250' align='center'>Prénom</td><td width='120' align='center'>type compte</td><td width='120' align='center'>Solde</td></tr>";
		echo"<tr><td>".$num."</td><td>".$nom."</td><td>".$prenom."</td><td>".$type."</td><td>".$solde."</td></tr>";
		echo"</table>";
		echo"</div>";
	}
	mysql_close($connexion);
}
?>
<?php
voici les tables
Code sql : 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
table client
client` (
  `id_clt` varchar(8) NOT NULL,
  `nom_clt` varchar(20) NOT NULL,
  `prenom_clt` varchar(50) NOT NULL,
  `datenais_clt` date NOT NULL,
  `lieunais_clt` varchar(30) NOT NULL,
  `sexe_clt` varchar(10) NOT NULL,
  `tel_clt` varchar(10) NOT NULL,
  `email_clt` varchar(50) NOT NULL,
  `ville_clt` varchar(30) DEFAULT NULL,
  `adres_clt` varchar(50) DEFAULT NULL,
  `motpass_clt` varchar(15) NOT NULL,
  PRIMARY KEY (`id_clt`),
  UNIQUE KEY `id_clt` (`id_clt`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
 
table compte
compte` (
  `num_compte` varchar(12) NOT NULL,
  `type_compte` varchar(10) NOT NULL,
  `solde_compte` int(10) DEFAULT '0',
  `date_compte` date NOT NULL,
  `id_clt` varchar(7) NOT NULL,
  `id_gest` varchar(7) NOT NULL,
  PRIMARY KEY (`num_compte`)