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
| <?php
include("_connect.php"); // voir Connexion au serveur et BDD
$table1 = "adherents";
$table2 = "cotis";
$SQL="
SELECT
$table2.numero_adh,
$table2.montant_cotis,
$table1.numero_adh,
$table1.nom_adh,
$table1.prenom_adh,
$table1.adresse_adh,
$table1.adresse2_adh,
$table1.cp_adh,
$table1.ville_adh
FROM
$table1,
$table2
WHERE $table1.numero_adh = $table2.numero_adh
AND
table2.montant_Cotis = >30
";
$result = mysql_query($SQL)or die('vous avez une Erreur SQL !--------><br />'.$sql.'<br />'.mysql_error());
////////////////////////////////////////////////////////////////////////////////
//echo "selection faite---------->";
echo mysql_numrows($result); // Pour Afficher le Nbre adh trouvé
//echo "<br>";
////////////////////////////////////////////////////////////////////////////////
// Construction de l'affichage
////////////////////////////////////////////////////////////////////////////////
while($data= mysql_fetch_array($result))
{
echo "<table cellspacing=2 cellpadding=2 border=1 width=300px>";
echo "<tr align=center><th>"; // rien dans la ligne entete
echo "<br>";
echo $data['numero_adh']."<br>";
echo $data['nom_adh'] ." ". $data['prenom_adh']. "<br>";
echo $data['adresse_adh']."<br>";
echo $data['adresse2_adh']."<br>";
echo $data['cp_adh'] ." ". $data['ville_adh']. "<br>";
echo "<br>";
echo "</th>";
echo "</tr>";
echo"</table>";
}
mysql_free_result ($result);
mysql_close();
?> |