<?php
// information pour la connection à le DB
require("../gestinc/connexion.php");
$etat='active';
//$link=mysql_connect("$host","$user","$password") or die('<font color=red>Erreur de connnection</font><br> '.mysql_error() );
//mysql_select_db("$bd") or die('<font color=red>Base inexistante</font><br> '.mysql_error() );
// Recuperation du
// Numero du Candidat
@$datein =$_POST['dateIn'];
@$dateout =$_POST['dateOut'];
//@$dateout =$_POST['dateOut'];
// requete SQL pour la recherche
echo"<table width=1000 border=0 align=center cellspacing=2 bgcolor=#FFFFFF>
<tr>
<td width=232 height=83><div align=center><img src=../images/fsdplogo.jpg alt='Fonds de Soutien et de Developpement de la Presse' width=239 height=80 /></div></td>
<td width=312> </td>
<td width=260><div align=center><strong>DIRECTION EXECUTIVE<br />
-- -- -- -- -- -- -- -- -- -- -- -- <br />
SERVICE COMMUNICATION ET DOCUMENTATION
</strong></div></td>
</tr>
<tr>
<td> </td>
<td><br />
<div align=center><strong>FICHE STATISTIQUE DES RECHARGES <br />
DU <font color=blue>$datein</font> AU <font color=blue>$dateout</font> SUR LE POSTE <font color=blue>$poste</font> </strong></div></td>
<td> </td>
</tr>
</table>"
?>
<table border="0" bgcolor="#C7D6F1" bordercolor="#000000" bordercolordark="#FFFFFF" cols="1" align="center">
<tr>
<td>
<div align="center">
<!--STATISTIQUE PAR LE STATUT -->
<?php
// information pour la connection à le DB
require("../gestinc/connexion.php");
$etat='active';
//$link=mysql_connect("$host","$user","$password") or die('<font color=red>Erreur de connnection</font><br> '.mysql_error() );
//mysql_select_db("$bd") or die('<font color=red>Base inexistante</font><br> '.mysql_error() );
// Recuperation du
// Numero du Candidat
@$datein =$_POST['dateIn'];
@$dateout =$_POST['dateOut'];
@$montant=$_POST['montant'];
// requete SQL pour la recherche
$sql="SELECT * FROM newrech WHERE ( montant='$montant' && date BETWEEN '$datein' AND '$dateout') ORDER BY id DESC LIMIT 1000
";
$reponse=@mysql_query($sql,$cnx) or die(mysql_error());
$total = @mysql_num_rows($reponse);
if($total) {
//requête pour la somme total
$sql="SELECT SUM(montant) FROM newrech WHERE( montant='$montant' && date BETWEEN '$datein' AND '$dateout')";
$reponse2=@mysql_query($sql) or die(mysql_error());
while(@$row0 = mysql_num_rows($reponse2)){
$somme = ($row0 [0]++);
echo ($somme);
// debut du tableau
echo '<table bgcolor="#FFFFFF" width="967" border="0" cellspacing="2" cellpadding="2">'."\n";
// première ligne on affiche les titres prénom et surnom dans 2 colonnes
echo '<tr>';
echo '<td bgcolor="#669999" align="center"><b><u>Date de recharge </u></b></td>';
echo '<td bgcolor="#669999" align="center"><b><u>Poste</u></b></td>';
echo '<td bgcolor="#669999" align="center"><b><u>Montant</u></b></td>';
// echo '<td bgcolor="#669999" align="center"><b><u>utilisateur</u></b></td>';
//echo '<td bgcolor="#669999"><b><u>Statut</u></b></td>';
// echo '<td bgcolor="#669999" align="center"><b><u>Priorité</u></b></td>';
echo '<td bgcolor="" align="center"><b><u></u></b></td>';
echo '<td bgcolor="#FFF"><b><u></u></b></td>';
//echo '<td bgcolor="#FFF"><b><u></u></b></td>';
echo '</tr>'."\n";
// lecture et affichage des résultats sur 2 colonnes, 1 résultat par ligne.
while($row = mysql_fetch_array($reponse)) {
echo '<tr>';
echo '<td bgcolor="#f0f0f0">'.$row["date"].'</td>';
echo '<td bgcolor="#f0f0f0">'.'<strong> </strong>'.$row["poste"].'</td>';
echo '<td bgcolor="#f0f0f0">'.$row["montant"].'</td>';
echo '<td bgcolor="#f0f0f0">'.$somme.'</td>';
//echo '<td bgcolor="#f0f0f0">'.$row["statut"].'</td>';
//echo '<td bgcolor="#f0f0f0">'.$row["priorite"].'</td>';
echo '<td bgcolor="#30BDF3" align="center"><a class=top11 href=appercuRech.php?IdRech='.$row["id"].'><img src=../images/appercu.png title="appercu" width=20 height=20 /></a></td>';
echo '<td bgcolor="#30BDF3" align="center"><a class=top11 href=modif_Rech.php?IdRech='.$row["id"].'><img src=../images/modifier.png title="modifier" width=20 height=20 /></a></td>';
//echo '<td bgcolor="#30BDF3" align="center"><a class=top11 href=modif_inci2.php?IdIncident='.$row["id"].'><img src=../images/cloturer.png title="Clôturer" width=20 height=20 /></a></td>';
echo '</tr>'."\n";
}
echo '</table>'."\n";
// fin du tableau.
}
}
else echo 'Pas de resultat pour cette statistique';
// on libère le résultat
mysql_free_result($reponse);
?>
,d'ou lorsque je fais mon enregistrement il me met erreur a la page 76
20 janv. 2014 à 13:46
$somme = ($row0 [0]++);
20 janv. 2014 à 15:08
20 janv. 2014 à 15:31
Il te met une erreur à la LIGNE (et non à la page) 76..
A cette ligne, comme te l'indique NHenry... tu as surement une erreur de syntaxe....
Est-ce que sans l'espace entre Row0 et les crochets ne corrigerait pas le souci ?? :
20 janv. 2014 à 16:38
20 janv. 2014 à 18:24