nain comprise | Code :
- <?php
- @$id_connect=mysql_connect('host','user','pass') or die ("Connexion impossible a la base de donnée" );
- @mysql_select_db('BDD') or die ("Impossible de se connecter à la base de données" );
- $sql='SELECT * FROM Donnees WHERE `service`="0"';
- $requete=mysql_query($sql);
- echo '<table cellspacing=0 width=840>';
- echo '<tr>';
- echo '<td></td>';
- echo '<td></td>';
- echo '<td bgcolor=orange align=center width=420 colspan=7>Indicateurs </td>';
- echo '<td bgcolor=orange width=360 align=center colspan=6>Nombre de mesures</td>';
- echo '</tr>';
- echo '<tr>';
- echo '<td></td>';
- echo '<td></td> ';
- echo '<td bgcolor=yellow align=center width=120 colspan=2>VMS</td>';
- echo '<td width=120 bgcolor=yellow align=center colspan=2>SMS</td>';
- echo '<td width=120 bgcolor=yellow align=center colspan=2>MMS</td>';
- echo '<td bgcolor=yellow align=center rowspan=2>Indice<br>de<br>gravite</td>';
- echo '<td bgcolor=yellow width=120 align=center colspan=2>VMS</td>';
- echo '<td width=120 bgcolor=yellow align=center colspan=2>SMS</td>';
- echo '<td width=120 bgcolor=yellow align=center colspan=2>MMS</td>';
- echo '</tr>';
- echo '<tr>';
- echo '<td></td>';
- echo '<td></td>';
- echo '<td bgcolor=yellow width=60 align=center>2G</td>';
- echo '<td bgcolor=yellow width=60 align=center>3G</td>';
- echo '<td bgcolor=yellow width=60 align=center>2G</td>';
- echo '<td bgcolor=yellow width=60 align=center>3G</td>';
- echo '<td bgcolor=yellow width=60 align=center>2G</td>';
- echo '<td bgcolor=yellow width=60 align=center>3G</td>';
- echo '<td bgcolor=yellow width=60 align=center>2G</td>';
- echo '<td bgcolor=yellow width=60 align=center>3G</td>';
- echo '<td bgcolor=yellow width=60 align=center>2G</td>';
- echo '<td bgcolor=yellow width=60 align=center>3G</td>';
- echo '<td bgcolor=yellow width=60 align=center>2G</td>';
- echo '<td bgcolor=yellow width=60 align=center>3G</td>';
- echo '</tr>';
- while ($resultat=mysql_fetch_array($requete)){
- switch ($resultat['id_index']){
- case 161:
- $objsms2G=$resultat['valeur'];
- break;
- case 162:
- $objmms2G=$resultat['valeur'];
- break;
- case 163:
- $objvms2G=$resultat['valeur'];
- break;
- case 164:
- $objsms3G=$resultat['valeur'];
- break;
- case 165:
- $objmms3G=$resultat['valeur'];
- break;
- case 166:
- $objvms3G=$resultat['valeur'];
- break;
- case 167:
- $objIG=$resultat['valeur'];
- break;
- case 168:
- $seuilsms2G=$resultat['valeur'];
- break;
- case 169:
- $seuilmms2G=$resultat['valeur'];
- break;
- case 170:
- $seuilvms2G=$resultat['valeur'];
- break;
- case 171:
- $seuilsms3G=$resultat['valeur'];
- break;
- case 172:
- $seuilmms3G=$resultat['valeur'];
- break;
- case 173:
- $seuilvms3G=$resultat['valeur'];
- break;
- case 174:
- $seuilIG=$resultat['valeur'];
- break;
- }
- }
- echo '<tr>';
- echo '<td></td>';
- echo '<td width="60" align="center">Objectif</td>';
- echo '<td align="center">'.$objvms2G.'</td>';
- echo '<td align="center">'.$objvms3G.'</td>';
- echo '<td align="center">'.$objsms2G.'</td>';
- echo '<td align="center">'.$objsms2G.'</td>';
- echo '<td align="center">'.$objmms2G.'</td>';
- echo '<td align="center">'.$objmms2G.'</td>';
- echo '<td align="center">'.$objIG.'</td>';
- echo '<td bgcolor=black></td>';
- echo '<td bgcolor=black></td>';
- echo '<td bgcolor=black></td>';
- echo '<td bgcolor=black></td>';
- echo '<td bgcolor=black></td>';
- echo '<td bgcolor=black></td>';
- echo '</tr>';
- echo '<tr>';
- echo '<td></td>';
- echo '<td width="60" align="center">Seuil</td>';
- echo '<td align="center">'.$seuilvms2G.'</td>';
- echo '<td align="center">'.$seuilvms3G.'</td>';
- echo '<td align="center">'.$seuilsms2G.'</td>';
- echo '<td align="center">'.$seuilsms3G.'</td>';
- echo '<td align="center">'.$seuilmms2G.'</td>';
- echo '<td align="center">'.$seuilmms3G.'</td>';
- echo '<td align="center">'.$seuilIG.'</td>';
- echo '<td bgcolor=black></td>';
- echo '<td bgcolor=black></td>';
- echo '<td bgcolor=black></td>';
- echo '<td bgcolor=black></td>';
- echo '<td bgcolor=black></td>';
- echo '<td bgcolor=black></td>';
- echo '</tr>';
- echo '<tr>';
- echo '<td bgcolor=black colspan="15"></td>';
- echo '</tr>';
- $jour=date("t" );
- $i=1;
- $mois=date("m" );
- $annee=date("Y" );
- while ($i<=$jour)
- {
- $date=date("d M", mktime(0, 0, 0, $mois, $i, $annee));
- $semaine=date("W", mktime(0, 0, 0, $mois, $i+1, $annee));
- $date2=date("d/m/y", mktime(0, 0, 0, $mois, $i, $annee));
- $sql2='SELECT `test` FROM Donnees WHERE valeur="'.$date2.'" AND id_index="2" AND service ="5"';
- $requete2=mysql_query($sql2);
- $sql_num_rows=mysql_num_rows($requete2);
- while ($resultat2=mysql_fetch_array($requete2)){
- $sql3='SELECT `id_index`, `valeur` FROM Donnees WHERE test="'.$resultat2['test'].'"';
- $requete3=mysql_query($sql3);
- while ($resultat3=mysql_fetch_array($requete3)){
- switch ($resultat3['id_index']) {
- case 81:
- $tnrsms2G=$resultat3['valeur'];
- break;
- case 82:
- $tnrsms3G=$resultat3['valeur'];
- break;
- case 83:
- $tnqpmms2G=$resultat3['valeur'];
- break;
- case 84:
- $tnqpmms3G=$resultat3['valeur'];
- break;
- case 85:
- $tervms2G=$resultat3['valeur'];
- break;
- case 86:
- $tervms3G=$resultat3['valeur'];
- break;
- case 87:
- $nbsms2G=$resultat3['valeur'];
- break;
- case 88:
- $nbsms3G=$resultat3['valeur'];
- break;
- case 89:
- $nbmms2G=$resultat3['valeur'];
- break;
- case 90:
- $nbmms3G=$resultat3['valeur'];
- break;
- case 91:
- $nbvms2G=$resultat3['valeur'];
- break;
- case 92:
- $nbvms2G=$resultat3['valeur'];
- break;
- case 93:
- $IG=$resultat3['valeur'];
- break;
- }
- }
- }
- //affichage ligne renseignée
- echo '<tr>';
- echo '<td width="40" align="center">S'.$semaine.'</td>';
- echo '<td width="60" align="center">';
- if ($sql_num_rows != 0){
- echo $date'</td>';
- if ($tervms2G!="" )
- {
- if ($tervms2G<$objvms2G)
- {
- echo '<td width="60" align="center"><font color="black">'.$tervms2G.'</font></td>';
- }
- elseif ($tervms2G<=$seuilvms2G)
- {
- echo '<td width="60" align="center"><font color="orange">'.$tervms2G.'</font></td>';
- }
- else
- {
- echo '<td width="60" align="center"><font color="red">'.$tervms2G.'</font></td>';
- }
- }
- else
- {
- echo '<td bgcolor="gray" width="60" align="center"></td>';
- }
- if ($tervms3G!="" )
- {
- if ($tervms3G<$objvms3G)
- {
- echo '<td width="60" align="center"><font color="black">'.$tervms3G.'</font></td>';
- }
- elseif ($tervms3G<=$seuilvms3G)
- {
- echo '<td width="60" align="center"><font color="orange">'.$tervms3G.'</font></td>';
- }
- else
- {
- echo '<td width="60" align="center"><font color="red">'.$tervms3G.'</font></td>';
- }
- }
- else
- {
- echo '<td bgcolor="gray" width="60" align="center"></td>';
- }
-
- if ($tnrsms2G!="" )
- {
- if ($tnrsms2G<$objsms2G)
- {
- echo '<td width="60" align="center"><font color="black">'.$tnrsms2G.'</font></td>';
- }
- elseif ($tnrsms2G<=$seuilsms2G)
- {
- echo '<td width="60" align="center"><font color="orange">'.$tnrsms2G.'</font></td>';
- }
- else
- {
- echo '<td width="60" align="center"><font color="red">'.$tnrsms2G.'</font></td>';
- }
- }
- else
- {
- echo '<td bgcolor="gray" width="60" align="center"></td>';
- }
-
- if ($tnrsms3G!="" )
- {
- if ($tnrsms3G<$objsms3G)
- {
- echo '<td width="60" align="center"><font color="black">'.$tnrsms3G.'</font></td>';
- }
- elseif($tnrsms3G<=$seuilsms3G)
- {
- echo '<td width="60" align="center"><font color="orange">'.$tnrsms3G.'</font></td>';
- }
- else
- {
- echo '<td width="60" align="center"><font color="red">'.$tnrsms3G.'</font></td>';
- }
- }
- else
- {
- echo '<td bgcolor="gray" width="60" align="center"></td>';
- }
-
- if ($tnqpmms2G!="" )
- {
- if ($tnqpmms2G<$objmms2G)
- {
- echo '<td width="60" align="center"><font color="black">'.$tnqpmms2G.'</font></td>';
- }
- elseif ($tnqpmms2G<=$seuilmms2G)
- {
- echo '<td width="60" align="center"><font color="orange">'.$tnqpmms2G.'</font></td>';
- }
- else
- {
- echo '<td width="60" align="center"><font color="red">'.$tnqpmms2G.'</font></td>';
- }
- }
- else
- {
- echo '<td bgcolor="gray" width="60" align="center"></td>';
- }
- if ($tnqpmms3G!="" )
- {
- if ($tnqpmms3G<$objmms3G)
- {
- echo '<td width="60" align="center"><font color="black">'.$tnqpmms3G.'</font></td>';
- }
- elseif ($tnqpmms3G<=$seuilmms3G)
- {
- echo '<td width="60" align="center"><font color="orange">'.$tnqpmms3G.'</font></td>';
- }
- else
- {
- echo '<td width="60" align="center"><font color="red">'.$tnqpmms3G.'</font></td>';
- }
- }
- else {
- echo '<td bgcolor="gray" width="60" align="center"></td>';
- }
-
- if ($IG != "" )
- {
- if ($IG < $objIG)
- {
- echo '<td width="60" align="center"><font color="black">'.$IG.'</font></td>';
- }
- elseif ($IG<=$seuilIG)
- {
- echo '<td width="60" align="center"><font color="orange">'.$IG.'</font></td>';
- }
- else
- {
- echo '<td width="60" align="center"><font color="red">'.$IG'</font></td>';
- }
- }
- else
- {
- echo '<td bgcolor="gray" width="60" align="center"></td>';
- }
-
- if ($nbvms2 != "" )
- {
- echo '<td width="60" align="center">'.$nbvms2G.'</td>';
- }
- else
- {
- echo '<td bgcolor="gray" width="60" align="center"></td>';
- }
- if ($nbvms3G != "" )
- {
- echo '<td width="60" align="center">'.$nbvms3G.'</td>';
- }
- else
- {
- echo '<td bgcolor="gray" width="60" align="center"></td>';
- }
- if ($nbsms2G != "" )
- {
- echo '<td width="60" align="center">'.$nbsms2G.'</td>';
- }
- else
- {
- echo '<td bgcolor="gray" width="60" align="center"></td>';
- }
- if ($nbsms2G != "" )
- {
- echo '<td width="60" align="center">'.$nbsms3G.'</td>';
- }
- else
- {
- echo '<td bgcolor="gray" width="60" align="center"></td>';
- }
- if ($nbmms2G!= "" )
- {
- echo '<td width="60" align="center">'.$nbmms2G.'</td>';
- }
- else
- {
- echo '<td bgcolor="gray" width="60" align="center"></td>';
- }
- if ($nbmms3G != "" )
- {
- echo '<td width="60" align="center">'.$nbmms3G.'</td>';
- }
- else
- {
- echo '<td bgcolor="gray" width="60" align="center"></td>';
- }
-
-
-
- }
- else
- {
- echo "$date";
- echo '</td>';
- echo '<td width="60" bgcolor="gray" align="center"></td>';
- echo '<td bgcolor="gray" width="60" align="center"></td>';
- echo '<td bgcolor="gray" width="60" align="center"></td>';
- echo '<td bgcolor="gray" width="60" align="center"></td>';
- echo '<td bgcolor="gray" width="60" align="center"></td>';
- echo '<td bgcolor="gray" width="60" align="center"></td>';
- echo '<td width="60" bgcolor="gray" align="center"></td>';
- echo '<td bgcolor="gray" width="60" align="center"></td>';
- echo '<td bgcolor="gray" width="60" align="center"></td>';
- echo '<td bgcolor="gray" width="60" align="center"></td>';
- echo '<td bgcolor="gray" width="60" align="center"></td>';
- echo '<td bgcolor="gray" width="60" align="center"></td>';
- echo '<td bgcolor="gray" width="60" align="center"></td>';
- echo '</tr>';
- }
- $i=$i+1;
- }
- echo '</table>';
- echo '<br><br><br><br><br>';
- mysql_close($id_connect);
- ?>
|
Le probleme c est que j ai
Code :
- Parse error: parse error, expecting `','' or `';'' in c:\program files\easyphp1-8\www\***_données.php on line 141
|
or les lignes 140 et 141 sont
Code :
- $sql_num_rows=mysql_num_rows($requete2);
- while ($resultat2=mysql_fetch_array($requete2)){
|
pour la 141 c est le debut de la boucle While il ne faut pas de ";" a la fin de la ligne et le ";" est bien present a la ligne 140.
J ai verifie qu il ne manque pas de ";" ou de guillemets , accolades, parenthéses...
|