je l'ai executer en direct dans la base de données . ça affiche un resultat mais pas comme je souhaite
SELECT * FROM notes a, tb_matieres c, inscription e WHERE a.eval = '".$class."' AND b.id = c.id AND a.date_enrg = '2014-04-02 18:51:30' AND c.matiere = '".$mat."' AND a.id_elv = e.id
FROM notes N, tb_matieres M, inscription I
'".$class."'par '6ième' et 'MATHEMATIQUES'
'".$mat."'par
$req = mysql_query("
SELECT
I.matricule,
I.id,
I.nom,
I.prenom,
I.sexe,
N.id,
N.eval,
N.id_elv,
N.note,
N.code,
N.pseudo,
N.obs,
M.matiere,
M.id_elv
FROM notes N,
tb_matieres M,
inscription I
WHERE N.eval = '".$class."'
AND N.id = M.id
AND M.matiere = '".$mat."'
AND N.id_elv = I.id
") or die('no');
?>
ça affiche un resultat mais pas comme je souhaite
echo $req;ça m 'affiche :
Quand je fait:..... Ben... normal..... Il te faut faire une boucle While pour traiter le résultat de ta requête.... avec un fecth_array par exemple.... ou un mysql_fetch_assoc (comme tu l'as fait dans tes autres discussions sur ce forum....)echo $req;ça m 'affiche : Resource id 8
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionN.id = M.id.
$req = mysql_query("SELECT
I.matricule,
I.id,
I.nom,
I.prenom,
I.sexe,
N.id,
N.eval,
N.id_elv,
N.note,
N.code,
N.pseudo,
N.obs,
M.matiere,
M.id_elv
FROM inscription I,
notes N,
tb_matieres M
WHERE N.eval = '".$class."'
AND N.id_elv = M.id_elv
AND M.matiere = '".$mat."'
AND N.id_elv = I.id
") or die('no');
?>
$sql="INSERT INTO notes(id,note,obs,pseudo,code,id_elv,eval,date_enrg) VALUES('','".$note."','".$obs."','".$_SESSION['pseudo']."','".$code."','".$id_elv."','".$desgn."',NOW())";
// on insère les informations du formulaire dans la table
mysql_query($sql) or die('Erreur SQL !'.$sql.'<br>'.mysql_error());
$id_last= mysql_insert_id();
mysql_query("INSERT INTO tb_matieres(id,matiere,id_elv) VALUES('".$id_last."','".$matiere."','".$id_elv."')") or die('error de la ieme requete');
mysql_query("INSERT INTO tb_classes(id,class,id_elv) VALUES('".$id_last."','".$class."','".$id_elv."')") or die('error de la ieme requete');
mysql_query("INSERT INTO tb_type_evaluation(id,eval,id_elv) VALUES('".$id_last."','".$eval."','".$id_elv."')") or die('error de la ieme requete');
mysql_query("INSERT INTO tb_coeff(id,coeff,id_elv) VALUES('".$id_last."','".$coeff."','".$id_elv."')") or die('error de la ieme requete');
<?php
include('menu/menu.php');
if(isset($_GET['mat'])); $mat = urldecode($_GET['mat']); //echo $mat;
if(isset($_GET['class'])); $class = urldecode($_GET['class']); //echo $class;
//calcul de moyennes
$q = mysql_query("SELECT *
FROM inscription I,
notes N,
tb_matieres M
WHERE I.id_inscri = N.id_elv
AND N.eval = '".$class."'
AND M.id = N.id_matiere
AND M.matiere = '".$mat."'
GROUP BY I.nom
ORDER BY I.nom ASC
") or die('no');
//echo $req;
?>
<table width="914" border="0" >
<tr style="font-family:Georgia, 'Times New Roman', Times, serif; font-size:14px; background-color:#408080; color:#FFF">
<td width="48" align="center">N°</td>
<td width="114" align="center">MATRICULE</td>
<td width="200">NOM</td>
<td width="307">PRENOMS</td>
<td width="38" align="center">S</td>
<td width="54" align="center">AGE</td>
<td width="46" align="center">RED</td>
<td width="73" align="center">NOTES</td>
</tr>
<?php
while($r = mysql_fetch_assoc($q)){
?>
<tr>
<td><?php //echo $r["nom"]; ?></td>
<td align="center"><?php echo $r["matricule"]; ?></td>
<td><?php echo $r["nom"]; ?></td>
<td><?php echo $r["prenom"]; ?></td>
<td align="center"><?php echo $r["sexe"]; ?></td>
<td align="center"><?php echo $r["date_naiss"]; ?></td>
<td align="center"><?php if($r["sexe"] == $class){echo 'R' ;}else{echo '';} ?></td>
<td align="center" style="color:red; font-weight:bold"><?php echo $r["note"]; ?></td>
</tr>
<?php
}
?>
</table>
je veux que toutes les notes de l'élève soient sur la même ligne que son nom .Tu ne peux pas directement via la requête.
$elevPrec = ""; while($r = mysql_fetch_assoc($q)){ $matelev = $r["matricule"]; if ($matelev != $elevPrec){ if($elevPrec !=""){ echo"</tr>"; } echo "<tr> <td>".$r["nom"]."</td> <td align='center'>".$r["matricule"]."</td> <td>".$r["nom"]."</td> <td>."$r["prenom"]."</td> <td align='center'>".echo $r["sexe"]."</td> <td align='center'>".$r["date_naiss"]."</td> <td align='center'>"; echo "<td align='center' style='color:red; font-weight:bold'>".$r["note"] ."</td>"; }else{ echo "<td align='center' style='color:red; font-weight:bold'>".$r["note"] ."</td>"; } $elevPrec = $matelev ; } echo"</tr>";
SELECT * FROM inscription I ,notes N ,tb_matieres M WHERE I.id_inscri = N.id_elv AND M.id = N.id_matiere AND N.eval = '".$class."' AND M.matiere = '".$mat."' ORDER BY I.matricule,I.id_matiere
SELECT *
FROM inscription I
,notes N
,tb_matieres M
WHERE I.id_inscri = N.id_elv
AND M.id = N.id_matiere
AND N.eval = '".$class."'
AND M.matiere = '".$mat."'
ORDER BY I.matricule,N.id_matiere
// 'bdd_ecole'.'inscription' $inscription = array( array('id_inscri' => '19','num' => '001','annee_scolaire' => '2013-2014','matricule' => '001/2014','affecte' => 'affecte','nom' => 'COULIBALY','prenom' => 'FRANCOIS','date_naiss' => '02/05/2000','sexe' => 'M','montant_inscript' => '75000','etabl_orgin' => 'LYCEE GARCON DE BINGERVILLE','drenet' => 'BINGERVILLE','niv_precdt' => '3i�¨me','decision_admissibilite' => 'Admis','som_tot_a_payer' => '75000','som_verse' => '75000','date_versmt' => '25/06/2014','date_prch_versmnt' => '25/06/2014','tel' => '22457895','fax' => '22457895','mail' => 'info@global-aeit.com','site' => 'www.global-aeit.com','pere' => 'kone madou','mere' => 'traoré jeanne','prers_ct' => 'COULIBALY VALLY','contact' => '01010125','avatar' => 'jolie.jpg','id_classe' => '1','id' => '84','note' => '12','obs' => 'Assez Bien','pseudo' => '','code' => '3','id_elv' => '19','eval' => '2ndA','coeff' => '2','date_enrg' => '2014-06-30 16:25:10','id_matiere' => '52','id' => '52','matiere' => 'MATHEMATIQUES'), array('id_inscri' => '19','num' => '001','annee_scolaire' => '2013-2014','matricule' => '001/2014','affecte' => 'affecte','nom' => 'COULIBALY','prenom' => 'FRANCOIS','date_naiss' => '02/05/2000','sexe' => 'M','montant_inscript' => '75000','etabl_orgin' => 'LYCEE GARCON DE BINGERVILLE','drenet' => 'BINGERVILLE','niv_precdt' => '3i�¨me','decision_admissibilite' => 'Admis','som_tot_a_payer' => '75000','som_verse' => '75000','date_versmt' => '25/06/2014','date_prch_versmnt' => '25/06/2014','tel' => '22457895','fax' => '22457895','mail' => 'info@global-aeit.com','site' => 'www.global-aeit.com','pere' => 'kone madou','mere' => 'traoré jeanne','prers_ct' => 'COULIBALY VALLY','contact' => '01010125','avatar' => 'jolie.jpg','id_classe' => '1','id' => '86','note' => '16','obs' => 'Trés bien','pseudo' => '','code' => '4','id_elv' => '19','eval' => '2ndA','coeff' => '1','date_enrg' => '2014-06-30 17:49:15','id_matiere' => '52','id' => '52','matiere' => 'MATHEMATIQUES'), array('id_inscri' => '19','num' => '001','annee_scolaire' => '2013-2014','matricule' => '001/2014','affecte' => 'affecte','nom' => 'COULIBALY','prenom' => 'FRANCOIS','date_naiss' => '02/05/2000','sexe' => 'M','montant_inscript' => '75000','etabl_orgin' => 'LYCEE GARCON DE BINGERVILLE','drenet' => 'BINGERVILLE','niv_precdt' => '3i�¨me','decision_admissibilite' => 'Admis','som_tot_a_payer' => '75000','som_verse' => '75000','date_versmt' => '25/06/2014','date_prch_versmnt' => '25/06/2014','tel' => '22457895','fax' => '22457895','mail' => 'info@global-aeit.com','site' => 'www.global-aeit.com','pere' => 'kone madou','mere' => 'traoré jeanne','prers_ct' => 'COULIBALY VALLY','contact' => '01010125','avatar' => 'jolie.jpg','id_classe' => '1','id' => '84','note' => '12','obs' => 'Assez Bien','pseudo' => '','code' => '3','id_elv' => '19','eval' => '2ndA','coeff' => '2','date_enrg' => '2014-06-30 16:25:10','id_matiere' => '52','id' => '52','matiere' => 'MATHEMATIQUES'), array('id_inscri' => '19','num' => '001','annee_scolaire' => '2013-2014','matricule' => '001/2014','affecte' => 'affecte','nom' => 'COULIBALY','prenom' => 'FRANCOIS','date_naiss' => '02/05/2000','sexe' => 'M','montant_inscript' => '75000','etabl_orgin' => 'LYCEE GARCON DE BINGERVILLE','drenet' => 'BINGERVILLE','niv_precdt' => '3i�¨me','decision_admissibilite' => 'Admis','som_tot_a_payer' => '75000','som_verse' => '75000','date_versmt' => '25/06/2014','date_prch_versmnt' => '25/06/2014','tel' => '22457895','fax' => '22457895','mail' => 'info@global-aeit.com','site' => 'www.global-aeit.com','pere' => 'kone madou','mere' => 'traoré jeanne','prers_ct' => 'COULIBALY VALLY','contact' => '01010125','avatar' => 'jolie.jpg','id_classe' => '1','id' => '86','note' => '16','obs' => 'Trés bien','pseudo' => '','code' => '4','id_elv' => '19','eval' => '2ndA','coeff' => '1','date_enrg' => '2014-06-30 17:49:15','id_matiere' => '52','id' => '52','matiere' => 'MATHEMATIQUES'), array('id_inscri' => '19','num' => '001','annee_scolaire' => '2013-2014','matricule' => '001/2014','affecte' => 'affecte','nom' => 'COULIBALY','prenom' => 'FRANCOIS','date_naiss' => '02/05/2000','sexe' => 'M','montant_inscript' => '75000','etabl_orgin' => 'LYCEE GARCON DE BINGERVILLE','drenet' => 'BINGERVILLE','niv_precdt' => '3i�¨me','decision_admissibilite' => 'Admis','som_tot_a_payer' => '75000','som_verse' => '75000','date_versmt' => '25/06/2014','date_prch_versmnt' => '25/06/2014','tel' => '22457895','fax' => '22457895','mail' => 'info@global-aeit.com','site' => 'www.global-aeit.com','pere' => 'kone madou','mere' => 'traoré jeanne','prers_ct' => 'COULIBALY VALLY','contact' => '01010125','avatar' => 'jolie.jpg','id_classe' => '1','id' => '84','note' => '12','obs' => 'Assez Bien','pseudo' => '','code' => '3','id_elv' => '19','eval' => '2ndA','coeff' => '2','date_enrg' => '2014-06-30 16:25:10','id_matiere' => '52','id' => '52','matiere' => 'MATHEMATIQUES'), array('id_inscri' => '19','num' => '001','annee_scolaire' => '2013-2014','matricule' => '001/2014','affecte' => 'affecte','nom' => 'COULIBALY','prenom' => 'FRANCOIS','date_naiss' => '02/05/2000','sexe' => 'M','montant_inscript' => '75000','etabl_orgin' => 'LYCEE GARCON DE BINGERVILLE','drenet' => 'BINGERVILLE','niv_precdt' => '3i�¨me','decision_admissibilite' => 'Admis','som_tot_a_payer' => '75000','som_verse' => '75000','date_versmt' => '25/06/2014','date_prch_versmnt' => '25/06/2014','tel' => '22457895','fax' => '22457895','mail' => 'info@global-aeit.com','site' => 'www.global-aeit.com','pere' => 'kone madou','mere' => 'traoré jeanne','prers_ct' => 'COULIBALY VALLY','contact' => '01010125','avatar' => 'jolie.jpg','id_classe' => '1','id' => '86','note' => '16','obs' => 'Trés bien','pseudo' => '','code' => '4','id_elv' => '19','eval' => '2ndA','coeff' => '1','date_enrg' => '2014-06-30 17:49:15','id_matiere' => '52','id' => '52','matiere' => 'MATHEMATIQUES'), array('id_inscri' => '19','num' => '001','annee_scolaire' => '2013-2014','matricule' => '001/2014','affecte' => 'affecte','nom' => 'COULIBALY','prenom' => 'FRANCOIS','date_naiss' => '02/05/2000','sexe' => 'M','montant_inscript' => '75000','etabl_orgin' => 'LYCEE GARCON DE BINGERVILLE','drenet' => 'BINGERVILLE','niv_precdt' => '3i�¨me','decision_admissibilite' => 'Admis','som_tot_a_payer' => '75000','som_verse' => '75000','date_versmt' => '25/06/2014','date_prch_versmnt' => '25/06/2014','tel' => '22457895','fax' => '22457895','mail' => 'info@global-aeit.com','site' => 'www.global-aeit.com','pere' => 'kone madou','mere' => 'traoré jeanne','prers_ct' => 'COULIBALY VALLY','contact' => '01010125','avatar' => 'jolie.jpg','id_classe' => '1','id' => '84','note' => '12','obs' => 'Assez Bien','pseudo' => '','code' => '3','id_elv' => '19','eval' => '2ndA','coeff' => '2','date_enrg' => '2014-06-30 16:25:10','id_matiere' => '52','id' => '52','matiere' => 'MATHEMATIQUES'), array('id_inscri' => '19','num' => '001','annee_scolaire' => '2013-2014','matricule' => '001/2014','affecte' => 'affecte','nom' => 'COULIBALY','prenom' => 'FRANCOIS','date_naiss' => '02/05/2000','sexe' => 'M','montant_inscript' => '75000','etabl_orgin' => 'LYCEE GARCON DE BINGERVILLE','drenet' => 'BINGERVILLE','niv_precdt' => '3i�¨me','decision_admissibilite' => 'Admis','som_tot_a_payer' => '75000','som_verse' => '75000','date_versmt' => '25/06/2014','date_prch_versmnt' => '25/06/2014','tel' => '22457895','fax' => '22457895','mail' => 'info@global-aeit.com','site' => 'www.global-aeit.com','pere' => 'kone madou','mere' => 'traoré jeanne','prers_ct' => 'COULIBALY VALLY','contact' => '01010125','avatar' => 'jolie.jpg','id_classe' => '1','id' => '86','note' => '16','obs' => 'Trés bien','pseudo' => '','code' => '4','id_elv' => '19','eval' => '2ndA','coeff' => '1','date_enrg' => '2014-06-30 17:49:15','id_matiere' => '52','id' => '52','matiere' => 'MATHEMATIQUES'), array('id_inscri' => '19','num' => '001','annee_scolaire' => '2013-2014','matricule' => '001/2014','affecte' => 'affecte','nom' => 'COULIBALY','prenom' => 'FRANCOIS','date_naiss' => '02/05/2000','sexe' => 'M','montant_inscript' => '75000','etabl_orgin' => 'LYCEE GARCON DE BINGERVILLE','drenet' => 'BINGERVILLE','niv_precdt' => '3i�¨me','decision_admissibilite' => 'Admis','som_tot_a_payer' => '75000','som_verse' => '75000','date_versmt' => '25/06/2014','date_prch_versmnt' => '25/06/2014','tel' => '22457895','fax' => '22457895','mail' => 'info@global-aeit.com','site' => 'www.global-aeit.com','pere' => 'kone madou','mere' => 'traoré jeanne','prers_ct' => 'COULIBALY VALLY','contact' => '01010125','avatar' => 'jolie.jpg','id_classe' => '1','id' => '84','note' => '12','obs' => 'Assez Bien','pseudo' => '','code' => '3','id_elv' => '19','eval' => '2ndA','coeff' => '2','date_enrg' => '2014-06-30 16:25:10','id_matiere' => '52','id' => '52','matiere' => 'MATHEMATIQUES'), array('id_inscri' => '19','num' => '001','annee_scolaire' => '2013-2014','matricule' => '001/2014','affecte' => 'affecte','nom' => 'COULIBALY','prenom' => 'FRANCOIS','date_naiss' => '02/05/2000','sexe' => 'M','montant_inscript' => '75000','etabl_orgin' => 'LYCEE GARCON DE BINGERVILLE','drenet' => 'BINGERVILLE','niv_precdt' => '3i�¨me','decision_admissibilite' => 'Admis','som_tot_a_payer' => '75000','som_verse' => '75000','date_versmt' => '25/06/2014','date_prch_versmnt' => '25/06/2014','tel' => '22457895','fax' => '22457895','mail' => 'info@global-aeit.com','site' => 'www.global-aeit.com','pere' => 'kone madou','mere' => 'traoré jeanne','prers_ct' => 'COULIBALY VALLY','contact' => '01010125','avatar' => 'jolie.jpg','id_classe' => '1','id' => '86','note' => '16','obs' => 'Trés bien','pseudo' => '','code' => '4','id_elv' => '19','eval' => '2ndA','coeff' => '1','date_enrg' => '2014-06-30 17:49:15','id_matiere' => '52','id' => '52','matiere' => 'MATHEMATIQUES'), array('id_inscri' => '20','num' => '002','annee_scolaire' => '2013-2014','matricule' => '002/2014','affecte' => 'affecte','nom' => 'SANOGO','prenom' => 'GEROME','date_naiss' => '25/06/2014','sexe' => 'M','montant_inscript' => '75000','etabl_orgin' => 'LYCEE GARCON DE BINGERVILLE','drenet' => 'BINGERVILLE','niv_precdt' => '3i�¨me','decision_admissibilite' => 'Admis','som_tot_a_payer' => '75000','som_verse' => '75000','date_versmt' => '25/06/2014','date_prch_versmnt' => '25/06/2014','tel' => '22457895','fax' => '22457895','mail' => 'info@global-aeit.com','site' => 'www.global-aeit.com','pere' => 'kone madou','mere' => 'KOUAKOU ANNE','prers_ct' => 'COULIBALY VALLY','contact' => '22436279','avatar' => 'jolie.jpg','id_classe' => '2','id' => '85','note' => '19','obs' => 'Trés bien','pseudo' => '','code' => '3','id_elv' => '20','eval' => '2ndA','coeff' => '2','date_enrg' => '2014-06-30 16:25:10','id_matiere' => '52','id' => '52','matiere' => 'MATHEMATIQUES'), array('id_inscri' => '20','num' => '002','annee_scolaire' => '2013-2014','matricule' => '002/2014','affecte' => 'affecte','nom' => 'SANOGO','prenom' => 'GEROME','date_naiss' => '25/06/2014','sexe' => 'M','montant_inscript' => '75000','etabl_orgin' => 'LYCEE GARCON DE BINGERVILLE','drenet' => 'BINGERVILLE','niv_precdt' => '3i�¨me','decision_admissibilite' => 'Admis','som_tot_a_payer' => '75000','som_verse' => '75000','date_versmt' => '25/06/2014','date_prch_versmnt' => '25/06/2014','tel' => '22457895','fax' => '22457895','mail' => 'info@global-aeit.com','site' => 'www.global-aeit.com','pere' => 'kone madou','mere' => 'KOUAKOU ANNE','prers_ct' => 'COULIBALY VALLY','contact' => '22436279','avatar' => 'jolie.jpg','id_classe' => '2','id' => '87','note' => '11','obs' => 'Insuffisant','pseudo' => '','code' => '4','id_elv' => '20','eval' => '2ndA','coeff' => '1','date_enrg' => '2014-06-30 17:49:15','id_matiere' => '52','id' => '52','matiere' => 'MATHEMATIQUES'),
<?php $aTest = array( array('id_inscri' => '19','num' => '001','annee_scolaire' => '2013-2014','matricule' => '001/2014','affecte' => 'affecte','nom' => 'COULIBALY','prenom' => 'FRANCOIS','date_naiss' => '02/05/2000','sexe' => 'M','montant_inscript' => '75000','etabl_orgin' => 'LYCEE GARCON DE BINGERVILLE','drenet' => 'BINGERVILLE','niv_precdt' => '3i�¨me','decision_admissibilite' => 'Admis','som_tot_a_payer' => '75000','som_verse' => '75000','date_versmt' => '25/06/2014','date_prch_versmnt' => '25/06/2014','tel' => '22457895','fax' => '22457895','mail' => 'info@global-aeit.com','site' => 'www.global-aeit.com','pere' => 'kone madou','mere' => 'traoré jeanne','prers_ct' => 'COULIBALY VALLY','contact' => '01010125','avatar' => 'jolie.jpg','id_classe' => '1','id' => '84','note' => '12','obs' => 'Assez Bien','pseudo' => '','code' => '3','id_elv' => '19','eval' => '2ndA','coeff' => '2','date_enrg' => '2014-06-30 16:25:10','id_matiere' => '52','id' => '52','matiere' => 'MATHEMATIQUES'), array('id_inscri' => '19','num' => '001','annee_scolaire' => '2013-2014','matricule' => '001/2014','affecte' => 'affecte','nom' => 'COULIBALY','prenom' => 'FRANCOIS','date_naiss' => '02/05/2000','sexe' => 'M','montant_inscript' => '75000','etabl_orgin' => 'LYCEE GARCON DE BINGERVILLE','drenet' => 'BINGERVILLE','niv_precdt' => '3i�¨me','decision_admissibilite' => 'Admis','som_tot_a_payer' => '75000','som_verse' => '75000','date_versmt' => '25/06/2014','date_prch_versmnt' => '25/06/2014','tel' => '22457895','fax' => '22457895','mail' => 'info@global-aeit.com','site' => 'www.global-aeit.com','pere' => 'kone madou','mere' => 'traoré jeanne','prers_ct' => 'COULIBALY VALLY','contact' => '01010125','avatar' => 'jolie.jpg','id_classe' => '1','id' => '86','note' => '16','obs' => 'Trés bien','pseudo' => '','code' => '4','id_elv' => '19','eval' => '2ndA','coeff' => '1','date_enrg' => '2014-06-30 17:49:15','id_matiere' => '52','id' => '52','matiere' => 'MATHEMATIQUES'), array('id_inscri' => '19','num' => '001','annee_scolaire' => '2013-2014','matricule' => '001/2014','affecte' => 'affecte','nom' => 'COULIBALY','prenom' => 'FRANCOIS','date_naiss' => '02/05/2000','sexe' => 'M','montant_inscript' => '75000','etabl_orgin' => 'LYCEE GARCON DE BINGERVILLE','drenet' => 'BINGERVILLE','niv_precdt' => '3i�¨me','decision_admissibilite' => 'Admis','som_tot_a_payer' => '75000','som_verse' => '75000','date_versmt' => '25/06/2014','date_prch_versmnt' => '25/06/2014','tel' => '22457895','fax' => '22457895','mail' => 'info@global-aeit.com','site' => 'www.global-aeit.com','pere' => 'kone madou','mere' => 'traoré jeanne','prers_ct' => 'COULIBALY VALLY','contact' => '01010125','avatar' => 'jolie.jpg','id_classe' => '1','id' => '84','note' => '12','obs' => 'Assez Bien','pseudo' => '','code' => '3','id_elv' => '19','eval' => '2ndA','coeff' => '2','date_enrg' => '2014-06-30 16:25:10','id_matiere' => '52','id' => '52','matiere' => 'MATHEMATIQUES'), array('id_inscri' => '19','num' => '001','annee_scolaire' => '2013-2014','matricule' => '001/2014','affecte' => 'affecte','nom' => 'COULIBALY','prenom' => 'FRANCOIS','date_naiss' => '02/05/2000','sexe' => 'M','montant_inscript' => '75000','etabl_orgin' => 'LYCEE GARCON DE BINGERVILLE','drenet' => 'BINGERVILLE','niv_precdt' => '3i�¨me','decision_admissibilite' => 'Admis','som_tot_a_payer' => '75000','som_verse' => '75000','date_versmt' => '25/06/2014','date_prch_versmnt' => '25/06/2014','tel' => '22457895','fax' => '22457895','mail' => 'info@global-aeit.com','site' => 'www.global-aeit.com','pere' => 'kone madou','mere' => 'traoré jeanne','prers_ct' => 'COULIBALY VALLY','contact' => '01010125','avatar' => 'jolie.jpg','id_classe' => '1','id' => '86','note' => '16','obs' => 'Trés bien','pseudo' => '','code' => '4','id_elv' => '19','eval' => '2ndA','coeff' => '1','date_enrg' => '2014-06-30 17:49:15','id_matiere' => '52','id' => '52','matiere' => 'MATHEMATIQUES'), array('id_inscri' => '19','num' => '001','annee_scolaire' => '2013-2014','matricule' => '001/2014','affecte' => 'affecte','nom' => 'COULIBALY','prenom' => 'FRANCOIS','date_naiss' => '02/05/2000','sexe' => 'M','montant_inscript' => '75000','etabl_orgin' => 'LYCEE GARCON DE BINGERVILLE','drenet' => 'BINGERVILLE','niv_precdt' => '3i�¨me','decision_admissibilite' => 'Admis','som_tot_a_payer' => '75000','som_verse' => '75000','date_versmt' => '25/06/2014','date_prch_versmnt' => '25/06/2014','tel' => '22457895','fax' => '22457895','mail' => 'info@global-aeit.com','site' => 'www.global-aeit.com','pere' => 'kone madou','mere' => 'traoré jeanne','prers_ct' => 'COULIBALY VALLY','contact' => '01010125','avatar' => 'jolie.jpg','id_classe' => '1','id' => '84','note' => '12','obs' => 'Assez Bien','pseudo' => '','code' => '3','id_elv' => '19','eval' => '2ndA','coeff' => '2','date_enrg' => '2014-06-30 16:25:10','id_matiere' => '52','id' => '52','matiere' => 'MATHEMATIQUES'), array('id_inscri' => '19','num' => '001','annee_scolaire' => '2013-2014','matricule' => '001/2014','affecte' => 'affecte','nom' => 'COULIBALY','prenom' => 'FRANCOIS','date_naiss' => '02/05/2000','sexe' => 'M','montant_inscript' => '75000','etabl_orgin' => 'LYCEE GARCON DE BINGERVILLE','drenet' => 'BINGERVILLE','niv_precdt' => '3i�¨me','decision_admissibilite' => 'Admis','som_tot_a_payer' => '75000','som_verse' => '75000','date_versmt' => '25/06/2014','date_prch_versmnt' => '25/06/2014','tel' => '22457895','fax' => '22457895','mail' => 'info@global-aeit.com','site' => 'www.global-aeit.com','pere' => 'kone madou','mere' => 'traoré jeanne','prers_ct' => 'COULIBALY VALLY','contact' => '01010125','avatar' => 'jolie.jpg','id_classe' => '1','id' => '86','note' => '16','obs' => 'Trés bien','pseudo' => '','code' => '4','id_elv' => '19','eval' => '2ndA','coeff' => '1','date_enrg' => '2014-06-30 17:49:15','id_matiere' => '52','id' => '52','matiere' => 'MATHEMATIQUES'), array('id_inscri' => '19','num' => '001','annee_scolaire' => '2013-2014','matricule' => '001/2014','affecte' => 'affecte','nom' => 'COULIBALY','prenom' => 'FRANCOIS','date_naiss' => '02/05/2000','sexe' => 'M','montant_inscript' => '75000','etabl_orgin' => 'LYCEE GARCON DE BINGERVILLE','drenet' => 'BINGERVILLE','niv_precdt' => '3i�¨me','decision_admissibilite' => 'Admis','som_tot_a_payer' => '75000','som_verse' => '75000','date_versmt' => '25/06/2014','date_prch_versmnt' => '25/06/2014','tel' => '22457895','fax' => '22457895','mail' => 'info@global-aeit.com','site' => 'www.global-aeit.com','pere' => 'kone madou','mere' => 'traoré jeanne','prers_ct' => 'COULIBALY VALLY','contact' => '01010125','avatar' => 'jolie.jpg','id_classe' => '1','id' => '84','note' => '12','obs' => 'Assez Bien','pseudo' => '','code' => '3','id_elv' => '19','eval' => '2ndA','coeff' => '2','date_enrg' => '2014-06-30 16:25:10','id_matiere' => '52','id' => '52','matiere' => 'MATHEMATIQUES'), array('id_inscri' => '19','num' => '001','annee_scolaire' => '2013-2014','matricule' => '001/2014','affecte' => 'affecte','nom' => 'COULIBALY','prenom' => 'FRANCOIS','date_naiss' => '02/05/2000','sexe' => 'M','montant_inscript' => '75000','etabl_orgin' => 'LYCEE GARCON DE BINGERVILLE','drenet' => 'BINGERVILLE','niv_precdt' => '3i�¨me','decision_admissibilite' => 'Admis','som_tot_a_payer' => '75000','som_verse' => '75000','date_versmt' => '25/06/2014','date_prch_versmnt' => '25/06/2014','tel' => '22457895','fax' => '22457895','mail' => 'info@global-aeit.com','site' => 'www.global-aeit.com','pere' => 'kone madou','mere' => 'traoré jeanne','prers_ct' => 'COULIBALY VALLY','contact' => '01010125','avatar' => 'jolie.jpg','id_classe' => '1','id' => '86','note' => '16','obs' => 'Trés bien','pseudo' => '','code' => '4','id_elv' => '19','eval' => '2ndA','coeff' => '1','date_enrg' => '2014-06-30 17:49:15','id_matiere' => '52','id' => '52','matiere' => 'MATHEMATIQUES'), array('id_inscri' => '19','num' => '001','annee_scolaire' => '2013-2014','matricule' => '001/2014','affecte' => 'affecte','nom' => 'COULIBALY','prenom' => 'FRANCOIS','date_naiss' => '02/05/2000','sexe' => 'M','montant_inscript' => '75000','etabl_orgin' => 'LYCEE GARCON DE BINGERVILLE','drenet' => 'BINGERVILLE','niv_precdt' => '3i�¨me','decision_admissibilite' => 'Admis','som_tot_a_payer' => '75000','som_verse' => '75000','date_versmt' => '25/06/2014','date_prch_versmnt' => '25/06/2014','tel' => '22457895','fax' => '22457895','mail' => 'info@global-aeit.com','site' => 'www.global-aeit.com','pere' => 'kone madou','mere' => 'traoré jeanne','prers_ct' => 'COULIBALY VALLY','contact' => '01010125','avatar' => 'jolie.jpg','id_classe' => '1','id' => '84','note' => '12','obs' => 'Assez Bien','pseudo' => '','code' => '3','id_elv' => '19','eval' => '2ndA','coeff' => '2','date_enrg' => '2014-06-30 16:25:10','id_matiere' => '52','id' => '52','matiere' => 'MATHEMATIQUES'), array('id_inscri' => '19','num' => '001','annee_scolaire' => '2013-2014','matricule' => '001/2014','affecte' => 'affecte','nom' => 'COULIBALY','prenom' => 'FRANCOIS','date_naiss' => '02/05/2000','sexe' => 'M','montant_inscript' => '75000','etabl_orgin' => 'LYCEE GARCON DE BINGERVILLE','drenet' => 'BINGERVILLE','niv_precdt' => '3i�¨me','decision_admissibilite' => 'Admis','som_tot_a_payer' => '75000','som_verse' => '75000','date_versmt' => '25/06/2014','date_prch_versmnt' => '25/06/2014','tel' => '22457895','fax' => '22457895','mail' => 'info@global-aeit.com','site' => 'www.global-aeit.com','pere' => 'kone madou','mere' => 'traoré jeanne','prers_ct' => 'COULIBALY VALLY','contact' => '01010125','avatar' => 'jolie.jpg','id_classe' => '1','id' => '86','note' => '16','obs' => 'Trés bien','pseudo' => '','code' => '4','id_elv' => '19','eval' => '2ndA','coeff' => '1','date_enrg' => '2014-06-30 17:49:15','id_matiere' => '52','id' => '52','matiere' => 'MATHEMATIQUES'), array('id_inscri' => '20','num' => '002','annee_scolaire' => '2013-2014','matricule' => '002/2014','affecte' => 'affecte','nom' => 'SANOGO','prenom' => 'GEROME','date_naiss' => '25/06/2014','sexe' => 'M','montant_inscript' => '75000','etabl_orgin' => 'LYCEE GARCON DE BINGERVILLE','drenet' => 'BINGERVILLE','niv_precdt' => '3i�¨me','decision_admissibilite' => 'Admis','som_tot_a_payer' => '75000','som_verse' => '75000','date_versmt' => '25/06/2014','date_prch_versmnt' => '25/06/2014','tel' => '22457895','fax' => '22457895','mail' => 'info@global-aeit.com','site' => 'www.global-aeit.com','pere' => 'kone madou','mere' => 'KOUAKOU ANNE','prers_ct' => 'COULIBALY VALLY','contact' => '22436279','avatar' => 'jolie.jpg','id_classe' => '2','id' => '85','note' => '19','obs' => 'Trés bien','pseudo' => '','code' => '3','id_elv' => '20','eval' => '2ndA','coeff' => '2','date_enrg' => '2014-06-30 16:25:10','id_matiere' => '52','id' => '52','matiere' => 'MATHEMATIQUES'), array('id_inscri' => '20','num' => '002','annee_scolaire' => '2013-2014','matricule' => '002/2014','affecte' => 'affecte','nom' => 'SANOGO','prenom' => 'GEROME','date_naiss' => '25/06/2014','sexe' => 'M','montant_inscript' => '75000','etabl_orgin' => 'LYCEE GARCON DE BINGERVILLE','drenet' => 'BINGERVILLE','niv_precdt' => '3i�¨me','decision_admissibilite' => 'Admis','som_tot_a_payer' => '75000','som_verse' => '75000','date_versmt' => '25/06/2014','date_prch_versmnt' => '25/06/2014','tel' => '22457895','fax' => '22457895','mail' => 'info@global-aeit.com','site' => 'www.global-aeit.com','pere' => 'kone madou','mere' => 'KOUAKOU ANNE','prers_ct' => 'COULIBALY VALLY','contact' => '22436279','avatar' => 'jolie.jpg','id_classe' => '2','id' => '87','note' => '11','obs' => 'Insuffisant','pseudo' => '','code' => '4','id_elv' => '20','eval' => '2ndA','coeff' => '1','date_enrg' => '2014-06-30 17:49:15','id_matiere' => '52','id' => '52','matiere' => 'MATHEMATIQUES') ); $elevPrec = ""; //while($r = mysql_fetch_assoc($q)){ echo "<table> <th>id_inscri</th> <th>Matricule</th> <th>Nom</th> <th>prenom</th> <th>Sexe</th> <th>Date_Naissance</th> <th>Note</th> <th>Note</th> <th>Note</th> <th>Note</th> <th>Note</th> <th>Note</th> <th>Note</th> <th>Note</th> <th>Note</th> <th>Note</th> <th>Note</th> <th>Note</th> "; foreach($aTest as $r){ $matelev = $r["matricule"]; if ($matelev != $elevPrec){ if($elevPrec !=""){ echo"</tr>"; } echo "<tr> <td>".$r["id_inscri"]."</td> <td align='center'>".$r["matricule"]."</td> <td>".$r["nom"]."</td> <td>".$r["prenom"]."</td> <td align='center'>".$r["sexe"]."</td> <td align='center'>".$r["date_naiss"]."</td>"; echo "<td align='center' style='color:red; font-weight:bold'>".$r["note"] ."</td>"; }else{ echo "<td align='center' style='color:red; font-weight:bold'>".$r["note"] ."</td>"; } $elevPrec = $matelev ; } echo"</tr>"; ?>
SELECT * FROM notes N WHERE N.id_elv=19
SELECT * FROM notes N WHERE N.id_elv=20
SELECT * FROM tb_matieres M WHERE M.matiere='MATHEMATIQUES'
donne :
SELECT *
FROM notes N
WHERE N.id_elv=19
SELECT *
FROM notes N
WHERE N.id_elv=20
SELECT *
FROM tb_matieres M
WHERE M.matiere='MATHEMATIQUES'
<select name="matiere" id="matiere" style="size:auto">2. et je fais la declaration de la variable comme ceci :
<option ></option>
<?php
$req2="SELECT DISTINCT matiere,id FROM matieres GROUP BY matiere ";
$res2=mysql_query($req2) or die("erreur dans la requête $req");
while ($tab2=mysql_fetch_object($res2)){
echo "<option >".$tab2->matiere.'/'.$tab2->id."</option>";
}
?>
</select>
//RECUPERATION DE L ID PRODUIT
$matiere = explode("/",$_POST["matiere"]);
$id_matiere = $matiere[1]; echo $id_matiere;
$matiere = $matiere[0]; echo $matiere;
<?php
while ($liste_etu = mysql_fetch_assoc($req)) {
$j=$i%2;
if (isset($_POST["valider"])) {
//for($i = 1; $i <= $res; $i++){
$note = mysql_real_escape_string(htmlentities(trim(Rec($_POST['note'.$liste_etu['id']]))));
$obs = mysql_real_escape_string(htmlentities(trim(Rec($_POST['obs'.$liste_etu['id']]))));
$id_elv = mysql_real_escape_string(htmlentities(trim(Rec($_POST['id_elv'.$liste_etu['id']]))));
$code = mysql_real_escape_string(htmlentities(trim(Rec($_POST['code'.$liste_etu['id']]))));
//$matiere = mysql_real_escape_string(htmlentities(trim(Rec($_POST['matiere']))));
$class = mysql_real_escape_string(htmlentities(trim(Rec($_POST['class']))));
$eval = mysql_real_escape_string(htmlentities(trim(Rec($_POST['eval']))));
$coeff = mysql_real_escape_string(htmlentities(trim(Rec($_POST['coeff']))));
//RECUPERATION DE L ID PRODUIT
$matiere = explode("/",$_POST["matiere"]);
$id_matiere = $matiere[1]; echo $id_matiere;
$matiere = $matiere[0]; echo $matiere;
//INSERTION DANS LA TABLE MATIERE
mysql_query("INSERT INTO tb_matieres(id,matiere) VALUES('".$id_matiere."','".$matiere."')") or die('error de la ieme requete');
$id_last = mysql_insert_id();
//INSERTION DE NOTES
$sql="INSERT INTO notes(id,note,obs,pseudo,code,id_elv,eval,coeff,date_enrg,id_matiere) VALUES('','".$note."','".$obs."','".$_SESSION['pseudo']."','".$code."','".$id_elv."','".$desgn."','".$coeff."',NOW(),'".$id_matiere."')";
// on insère les informations du formulaire dans la table
mysql_query($sql) or die('Erreur SQL !'.$sql.'<br>'.mysql_error());
mysql_query("INSERT INTO tb_type_evaluation(id,eval,id_elv) VALUES('".$id_last."','".$eval."','".$id_elv."')") or die('error de la ieme requete');
//mysql_query("INSERT INTO tb_coeff(id,coeff,id_elv) VALUES('".$id_last."','".$coeff."','".$id_elv."')") or die('error de la ieme requete');
header("location: index.php?page=affiche_notes&code=".$code);
}
echo'
<tr bgcolor=#33FFFF>
<td bgcolor="#F0F0F0"><span class="Style10">
<div class="numbers0" style="color:#FFF; ">'.$liste_etu['nom'].'</div>
</span></td>
<td bgcolor="#F0F0F0"><div class="numbers0" style="color:#FFF; ">'.$liste_etu['prenom'].'</div></td>
<td bgcolor="#F0F0F0"><input name="note'.$liste_etu['id'].'" type="text" size="20" style="width:120px"/></td>
<td bgcolor="#F0F0F0" align="center">
<select name="obs'.$liste_etu['id'].'">
<option></option>
<option>Trés bien</option>
<option>Bien</option>
<option>Assez Bien</option>
<option>Passable</option>
<option>Insuffisant</option>
</select>
</td>
<td bgcolor="#F0F0F0"><input name="code'.$liste_etu['id'].'" value="'.$r2['code'].'" type="text" size="20" style="width:120px"/></td>
<td bgcolor="#F0F0F0"><input name="id_elv'.$liste_etu['id'].'" value="'.$liste_etu['id_inscri'].'" type="text" size="20" style="width:120px"/></td>
</tr>
';
}
?>
//INSERTION DANS LA TABLE MATIERE
//mysql_query("INSERT INTO tb_matieres(id,matiere) VALUES('".$id_matiere."','".$matiere."')") or die('error de la ieme requete');
//$id_last = mysql_insert_id();
//RECUPERATION DE L ID PRODUIT3.2- pour l'affichage des notes comme je veux :
$matiere = explode("/",$_POST["matiere"]);
$id_matiere = $matiere[1]; echo $id_matiere;
$matiere = $matiere[0]; echo $matiere;
//INSERTION DANS LA TABLE MATIERE
//mysql_query("INSERT INTO tb_matieres(id,matiere) VALUES('".$id_matiere."','".$matiere."')") or die('error de la ieme requete');
//$id_last = mysql_insert_id();
//INSERTION DE NOTES
$sql="INSERT INTO notes(id,note,obs,pseudo,code,id_elv,eval,coeff,date_enrg,id_matiere) VALUES('','".$note."','".$obs."','".$_SESSION['pseudo']."','".$code."','".$id_elv."','".$desgn."','".$coeff."',NOW(),'".$id_matiere."')";
// on insère les informations du formulaire dans la table
mysql_query($sql) or die('Erreur SQL !'.$sql.'<br>'.mysql_error());
$q = mysql_query("SELECT *
FROM inscription I
,notes N
,matieres M
WHERE I.id_inscri = N.id_elv
AND M.id = N.id_matiere
AND N.eval = '".$class."'
AND M.matiere = '".$mat."'
ORDER BY I.matricule,N.id_matiere
") or die('no');