La Communauté Webmaster  forum rss


  Forum-webmaster
  Technique - programmation
  PHP / MySQL
(Modérateurs: Shain, Jey, erwinol, Lilian, lauryv, ToToMaStEr)
  probleme d'encodage
« Précédent Suivant »
Pages: [1] Descendre
Répondre    Aviser des réponses    Envoyer le sujet    Imprimer
  Auteur  Sujet: probleme d'encodage  (Lu 778 fois)
probleme d'encodage
« sur: le 04-11-2010 a 18:54:18 »
oliv56640
Membre récent
*

Hors-Ligne

Messages: 3





Voir le Profil
Répondre avec citation

Bojour à tous,

voilà mon pb,

j'ai testé ma requête sur phpmyadmin et elle fonctionne.

Le soucis es qu'une fois sur le site le résultat escompté n'est plus le bon .

Voilà le code:
Code:

<?php

include('global/haut.php');

include('global/entete.php');

include('global/menus.php');

if(isset($_SESSION['ident']))
   {

?>
   <!-- Le corps -->
<div id="corps">
     

<fieldset>

<?php echo 'Bonjour ' . $_SESSION['ident']; ?> bienvenue sur votre espace abonné <br />

   
       
   <?php   
   if (isset($_POST['mot_de_passe']) AND $_POST['mot_de_passe'] == "k" OR $_POST['mot_de_passe'] == "a") // Si le mot de passe est bon
   {
   // On affiche les codes
   ?>

<?php
try
{
   $bdd = new PDO('mysql:host=localhost;dbname=sport', 'root', '');
}
catch(Exception $e)
{
        die('Erreur : '.$e->getMessage());
}
$reponse = $bdd->prepare('SELECT * FROM demande WHERE ident = ?');
$reponse->execute(array($_GET['ident']));
$donnees = $reponse->fetch();

?>


<?php
$reponse = $bdd->prepare('SELECT COUNT(*) AS nb_diplome FROM demande where
  diplome = :diplome and
  diplome1 = :diplome1 and
  dpt = :dpt and
  date_dp >= :date_dp and
  date_fp <= :date_fp and
  heure_lud >= :heure_lud and
  heure_luf <= :heure_luf and
  heure_mad >= :heure_mad and
  heure_maf <= :heure_maf and
  heure_med >= :heure_med and
  heure_mef <= :heure_mef and
  heure_jed >= :heure_jed and
  heure_jef <= :heure_jef and
  heure_ved >= :heure_ved and
  heure_vef <= :heure_vef and
  heure_sad >= :heure_sad and
  heure_saf <= :heure_saf and
  heure_did >= :heure_did and
  heure_dif <= :heure_dif'
);
$reponse->execute(array(':diplome' => $donnees['diplome'],
               ':diplome1' => $donnees['diplome1'],
               ':dpt' => $donnees['dpt'],
               ':date_dp' => $donnees['date_dp'],
               ':date_fp' => $donnees['date_fp'],
               ':heure_lud' => $donnees['heure_lud'],
               ':heure_luf' => $donnees['heure_luf'],
               ':heure_mad' => $donnees['heure_mad'],
               ':heure_maf' => $donnees['heure_maf'],
               ':heure_med' => $donnees['heure_med'],
               ':heure_mef' => $donnees['heure_mef'],
               ':heure_jed' => $donnees['heure_jed'],
               ':heure_jef' => $donnees['heure_jef'],
               ':heure_ved' => $donnees['heure_ved'],
               ':heure_vef' => $donnees['heure_vef'],
               ':heure_sad' => $donnees['heure_sad'],
               ':heure_saf' => $donnees['heure_saf'],
               ':heure_did' => $donnees['heure_did'],
               ':heure_dif' => $donnees['heure_dif']
               )
            );

$donnees = $reponse->fetch();
echo $donnees['nb_diplome'];

$reponse->closeCursor();

?>
candidats correspondent à vos attentes.
<br />
Voici la liste et les coordonnées des candidats selectionnés :


<?php

$reponse = $bdd->prepare("select b.* from bees b join
(select cand.idbees from demande cand, demande client where client.ident !='' and client.ident = :ident and cand.idbees !=''
and client.diplome = cand.diplome and client.diplome1 = cand.diplome1 and client.dpt = cand.dpt
and cand.date_dp <= client.date_dp and cand.date_fp >= client.date_fp
and cand.heure_lud <= client.heure_lud and cand.heure_luf <= client.heure_luf
and cand.heure_mad <= client.heure_mad and cand.heure_maf >= client.heure_maf
and cand.heure_med <= client.heure_med and cand.heure_maf >= client.heure_maf
and cand.heure_jed <= client.heure_jed and cand.heure_jef >= client.heure_jef
and cand.heure_ved <= client.heure_ved and cand.heure_vef >= client.heure_vef
and cand.heure_sad <= client.heure_sad and cand.heure_saf >= client.heure_saf
and cand.heure_did <= client.heure_did and cand.heure_dif >= client.heure_dif)
t on t.idbees = b.idbees");
$reponse->execute(array(':ident' =>$_SESSION['ident']));


while ($donnees = $reponse->fetch())
{
?>
    <p>
   
    <?php echo $donnees['civ']; ?>  <?php echo $donnees['nom']; ?>  <?php echo $donnees['prenom']; ?><br />
    Coordonnées :<br /><?php echo $donnees['adresse']; ?> <?php echo $donnees['cplt_adresse']; ?> <?php echo $donnees['code_postal']; ?> <?php echo $donnees['ville']; ?><br />
    telephone 1: <?php echo $donnees['fixe']; ?> <br />telephone 2 : <?php echo $donnees['gsm']; ?> <br /> email :<?php echo $donnees['email']; ?>
  </p>
<?php
}

$reponse->closeCursor();

?>

</fieldset>
<?php
   }
   else // Sinon, on affiche un message d'erreur
   {
      echo '<p>Mot de passe incorrect</p>';
   }
   ?>

</div>

<br />

    <?php
   
   }
else
   echo '<p>Vous n\'êtes pas connecté(e).</p>';
?>   
   
<?php include("global/pdp.php"); ?>   

</html>



lorsque je remplace dans la premiere requete ident par idbees j'ai l'erreur suivante :
Code:

Notice: Undefined index: idbees in C:\wamp\www\SBEv8111010\abonnementcl.php on line 39


qui peux m'aider

Rapporter au modérateur  

Re:probleme d'encodage
« Répondre #1 sur: le 04-11-2010 a 20:54:48 »
MarvinLeRouge
Superactif
****

Hors-Ligne

Messages: 584





Voir le Profil    WWW
Répondre avec citation

Salut,

Tu as bien utilisé le bon nom de variable partout ? Je sais, ça paraît bête comme remarque, mais comme il y a marqué ident à pas mal d'endroits dans ton code, il pourrait y en avoir un qui aurait dû être changé et qui ne l'a pas été (ou le contraire).
Affiche ton tableau $_GET, et ta requète, pour vérifier.

Rapporter au modérateur  

Développeur web / Création de site internet
jean@ceugniet.com
Jean Ceugniet, Développement web
SIRET : 523 611 044 00018
Re:probleme d'encodage
« Répondre #2 sur: le 05-11-2010 a 11:04:19 »
oliv56640
Membre récent
*

Hors-Ligne

Messages: 3





Voir le Profil
Répondre avec citation

Merci, j'avais effectivement une difference de variable.

Ca marche j'ai à l'ecran les coordonnées des selectionnés par contre le comptage est faux.

j'i le total des deux champs idbees et ident ayant les mêmes critéres aors que je ne veux que le total des idbees

comment faire?

Rapporter au modérateur  
Re:probleme d'encodage
« Répondre #3 sur: le 11-11-2010 a 22:22:52 »
MarvinLeRouge
Superactif
****

Hors-Ligne

Messages: 584





Voir le Profil    WWW
Répondre avec citation

Tu as dû t'embrouiller et utiliser une variable au lieu de l'autre, ou le même nom pour tout, ce qui revient plus ou moins au même.

Rapporter au modérateur  

Développeur web / Création de site internet
jean@ceugniet.com
Jean Ceugniet, Développement web
SIRET : 523 611 044 00018
Re:probleme d'encodage
« Répondre #4 sur: le 12-11-2010 a 10:44:15 »
oliv56640
Membre récent
*

Hors-Ligne

Messages: 3





Voir le Profil
Répondre avec citation

Merci Marvin,

Mais j'ai verifié et je ne vois pas ou ça peche...

Rapporter au modérateur  
Répondre    Aviser des réponses    Envoyer le sujet    Imprimer
Pages: [1] Monter
« Précédent Suivant »
Sauter à: 

Votre statut : Invité
Vous devez être membre pour participer.
 
 
Let’s Encrypt : le certificat SSL gratuit
Tester votre site internet sur différents navigateurs
[WordPress] Des problèmes avec l’administration ?
Rappel : Mettez à jour vos CMS et vos sites E-commerce
Le .fr fête ses 25 années d’existence !
Mesurer votre audience en temps réel avec BubbleStat
Porter réclamation contre Google Panda ?
Zlio n’est plus …
 
 
 
 
 

Copyright (c) Devclic 2002 - 2026 - Tous droits réservés

creation site internet strasbourg