Jump to content

if in query


techker

Recommended Posts

hey guys i have this query up to know that works like i need..but i would like to add an if clause to trigger a notification if the student has more then 2 detentions with the same teacher??

 

 

k i got this going shows me the count and the student

 

///search student teacher repeat fr

$fileSQL="SELECT COUNT(*), `Etudiant`, `Prof` FROM Rapport_R\n"
    . "GROUP BY `Etudiant`, `Prof`\n"
    . "HAVING COUNT(*)>1";

$fileLIST=mysql_query($fileSQL);

 

///french\\

<? while ($row = mysql_fetch_array($fileLIST)) { ?>
     <? echo $row['Etudiant'] ?> a <? echo $row['COUNT(*)'] ?> retenues Avec le Professeur <? echo $row['Prof'] ?> </br>
  <? } ?>

the DB has

 

ID-Etudiant-Prof-Day-Notes

 

 

Link to comment
https://forums.phpfreaks.com/topic/251108-if-in-query/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.