Eléphanteau du PHP |
37 Messages
05 févr. 2006, 13:05
$serveur = "localhost"; // nom du serveur
$user = "root"; // nom utilisatieur
$pass = ""; // mot de passe
$bdd = "compte rendu activite"; // nom de la base de donnees
$mysql = "serveur/mysql/"; //nom du serveur MYSQL
$connect_db = mysql_connect($serveur,$user,$pass); // connection a la base de donnee
mysql_select_db($bdd,$connect_db); // selection de la base de donnee
// qui se trouve dans un fichier config.php puis je include dans mes fichiers
<? $result = substr($choix,0,strpos($choix,".")); $annee = substr($result,11,strlen($result)); ?>
<br>
<table bgcolor=#848484 bordercolordark=#848484 bordercolorloght=#848484 align=center>
<tr><td align=center>
<table bgcolor=#DEE7DE align=center width=440>
<tr><td align=center>
<table align=center><tr>
<? if($semaine != "")
{echo("
<table><tr><td><a href=tete.php?cra=calendrier>< Retour au calendrier ></td></tr></table><br>
<table><tr><td>Agent: 820017</td><td>HENAULT Stéphane (CE)</td><td><b>Semaine $semaine</b></td></tr></table>
<table><tr><td>Agence: 02.3.N.11</td><td>NEVERS (CE)</td><td>Date compta <b>Semaine $semaine</b></td></tr></table>");
$requete_cra = mysql_query("select * from $annee where semaine='$semaine' order by n_jours asc");
$verif = mysql_numrows($requete_cra);
if($verif == "0") {echo("<center><b><i>Il n'y a aucun enregistrement qui correspond a votre recherche !!</i></b></center>");}
while($ligne = mysql_fetch_array($requete_cra))
{
$n_client = $ligne["n_client"];
$jours = $ligne["jours"];
$n_jours = $ligne["n_jours"];
$mois = $ligne["mois"];
$semaine = $ligne["semaine"];
$client = $ligne["client"];
$localite = $ligne["localite"];
$contrat = $ligne["contrat"];
$nf = $ligne["nf"];
$repas = $ligne["repas"];
$vacation = $ligne["vacation"];
$km = $ligne["km"];
$hotel = $ligne["hotel"];
$peage = $ligne["peage"];
$parking = $ligne["parking"];
$divert = $ligne["divert"];
$frais_speciaux = $ligne["frais_speciaux"];
$montant_fs = $ligne["montant_fs"];
$indem_speciales = $ligne["indem_speciales"];
$quantite = $ligne["quantite"];
$H04_00 = $ligne["H04_00"];
$H04_30 = $ligne["H04_30"];
$H05_00 = $ligne["H05_00"];
$H05_30 = $ligne["H05_30"];
$H06_00 = $ligne["H06_00"];
$H06_30 = $ligne["H06_30"];
$H07_00 = $ligne["H07_00"];
$H07_30 = $ligne["H07_30"];
$H08_00 = $ligne["H08_00"];
$H08_30 = $ligne["H08_30"];
$H09_00 = $ligne["H09_00"];
$H09_30 = $ligne["H09_30"];
$H10_00 = $ligne["H10_00"];
$H10_30 = $ligne["H10_30"];
$H11_00 = $ligne["H11_00"];
$H11_30 = $ligne["H11_30"];
$H12_00 = $ligne["H12_00"];
$H12_30 = $ligne["H12_30"];
$H13_00 = $ligne["H13_00"];
$H13_30 = $ligne["H13_30"];
$H14_00 = $ligne["H14_00"];
$H14_30 = $ligne["H14_30"];
$H15_00 = $ligne["H15_00"];
$H15_30 = $ligne["H15_30"];
$H16_00 = $ligne["H16_00"];
$H16_30 = $ligne["H16_30"];
$H17_00 = $ligne["H17_00"];
$H17_30 = $ligne["H17_30"];
$H18_00 = $ligne["H18_00"];
$H18_30 = $ligne["H18_30"];
$H19_00 = $ligne["H19_00"];
$H19_30 = $ligne["H19_30"];
echo("
<table><tr><td>$jours - $n_jours - $mois</td></tr></table>
");}}
elseif($mois != "")
{echo("
<table><tr><td><a href=tete.php?cra=calendrier>< Retour au calendrier ></td></tr></table><br>
<table><tr><td>Agent: 820017</td><td>HENAULT Stéphane (CE)</td><td>Mois de <b>$mois</b></td></tr></table>
<table><tr><td>Agence: 02.3.N.11</td><td>NEVERS (CE)</td><td>Date compta <b>$mois $annee</b></td></tr></table>
");}?>
</tr></table></tr></table>
La page d'affichage
< Retour au calendrier >
Agent: 820017 HENAULT Stéphane (CE) Semaine 04
Agence: 02.3.N.11 NEVERS (CE) Date compta Semaine 04
Warning: mysql_numrows(): supplied argument is not a valid MySQL result resource in c:\program files\easyphp\www\cra\visualisation.php on line 18
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in c:\program files\easyphp\www\cra\visualisation.php on line 20
l'erreur obtenu