Tri Adherents

Tri Adherents

Tri des adhérents par cours

[insert_php]
include(‘Ancien/Bidon/config.php’);
$bdd = new PDO(‘mysql:host=ikebana-eota.eu.mysql;dbname=ikebana_eota_eu;charset=utf8’, ‘ikebana_eota_eu’, $SQLpass);
//$groupe = $_POST[‘groupe’];

function LireTable($bdd,$LaTable,$Nb,$array,$gr)
{
//echo ‘La table ‘ . $LaTable . ‘ Nombre :’ . $Nb;
//$sql = “SELECT * FROM $LaTable where groupe like $gr”;
if ($gr > 99)
{
$sql = “SELECT * FROM $LaTable” ;
}
else
{
$sql = “SELECT * FROM $LaTable where groupe like $gr”;
}

try
{
$stmt = $bdd->prepare($sql, array(PDO::ATTR_CURSOR, PDO::CURSOR_SCROLL));
$stmt->execute();
echo ‘‘;
for ($i=0; $i<=$Nb; $i++) { echo ' ‘.$array[$i].’

‘;}
echo ‘‘;
while ($row = $stmt->fetch(PDO::FETCH_NUM, PDO::FETCH_ORI_NEXT))
{
echo ‘‘;
for ($i=1; $i<$Nb; $i++) { echo ' ‘ . $row[$i] . ‘

‘;}
echo ‘‘;

}
$stmt = null;
$sql = null;
}
catch (PDOException $e)
{
print $e->getMessage();
}

}

[/insert_php]




lister.html

[insert_php]

//echo “Liste des cours :\n
“;
$label1 = array(‘Id’,’Groupe’,’Cours’,’Professeur’,’Horaire’,’Jour’,’Niveau’,’Nb Stagiare’);
$LaTable = ‘cours’;
$Nb = 8;
$gr = 100;
LireTable($bdd,$LaTable,$Nb,$label1,$gr);
[/insert_php]

Choisir un groupe, entrez 100 si tous les groupes

Donnez le groupe :