Tom's Guide > Forum > Programmation > Pb php requête base de données [Résolu]
Mot :    Pseudo :           
 

Bonjour à tous.

J'ai une erreur, a l'affichage ça donne ça :

SELECT * FROM poste whereCoef between 0 and 1000 order by Total desc

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in D:\Program Files\EasyPHP 2.0b1\www\Site_HAY\tableau.php on line 182

mais je comprend pas à quoi cela signifie.

Voici le bout de code auquel sa correspond :

Code :
  1. // requête SQL qui compte le nombre total d'enregistrement dans la table et qui récupère tous les enregistrements
  2. $select = 'SELECT * FROM poste order by Total desc';
  3. echo $select;
  4. $result = mysql_query($select);
  5. echo $result;
  6. $total = mysql_num_rows($result); // ligne 182
  7. echo $total;



Merci


Message édité par Bruenor911 le 10-04-2008 à 09:04:06
Liens sponsorisés
Inscrivez-vous ou connectez-vous pour masquer ceci.

il est en ligne ton site? sinon c'est normal...

Répondre à mpoo

le bout de code ne correspond pas à l'erreur
et l'erreur porte sur le "whereCoef" attaché, il faut un espace

------------------------------ Ne pas oublier le [resolu] pour finir le sujet.
Penser à voir les tutos, ca peut aider!
Répondre à coca25

Mon site (en fait c'est une petite appli avec interface web), est en local pour l'instant.

Je fais comment pour séparé le "whereCoef" vu que ce n'est que l'affichage de ma variable select ?

Je peux mettre le code complet si vous le souhaitez.

Personnelement je suis un débutant total en php, je ne fait que poursuivre le developpement de cette mini appli.

Répondre à Bruenor911

Bruenor911 a écrit :


Je fais comment pour séparé le "whereCoef" vu que ce n'est que l'affichage de ma variable select ?



Tu mets un espace entre "where" et "Coef" ta requête devrait être:

SELECT * FROM poste where Coef between 0 and 1000 order by Total desc

------------------------------ angela936 a écrit :"l'homosexualité est toléré sur le forum pourquoi pas l'homophobie ?!"
Répondre à lucoz

Re

ça change rien,

Je met mon code en entier pour ce fichier des fois que ça aide :

Code :
  1. <?php
  2. // inclusion du logo
  3. include ("logo.php" );
  4. //inclusion de l'en-tête de page
  5. // By me
  6. //if (!array_key_exists('print',$_GET)) $_GET['print']=0;
  7. if (!$_GET['print']) include ("_top.php" );
  8. //inclusion du fichier contenant les différentes fonctions
  9. include ("fonctions.php" );
  10. ?>
  11. <!--Page de répartition des postes -->
  12. <h2 align = "center">Répartition des postes</h2>
  13. <!--Formulaire de tri -->
  14. <?php
  15.     // By me
  16.     //if (!array_key_exists('print',$_GET)) $_GET['print']=0;
  17.     if (!$_GET['print'])
  18. {
  19. ?>
  20. <form method="post" name="tri">
  21.   <div align="center"><strong><em>Sélectionnez vos critères de tri :</em></strong></div>
  22.   <table border="1" align = "center">
  23.     <tr>
  24.       <td colspan="4" align="center" bordercolor="#FFFFFF">
  25.               <?php $listeClassif=array("Tous"=>"Tous","Non Cadre"=>"Non Cadre","Cadre"=>"Cadre" );
  26.                 echo 'Classification : <select name="triClassif" onchange="document.tri.submit()">';
  27.                 foreach ($listeClassif as $key=>$value)
  28.                 {
  29.                     $selected = ($_POST['triClassif'] == $key)?'selected':'';
  30.                     echo '<option value="'.$key.'" '.$selected.'>'.$value.'</option>';
  31.                 }
  32.                 echo '</select>';
  33.                 $listeEtat=array("Tous"=>"Tous","Actif"=>"Actif","Non Actif"=>"Non Actif" );
  34.                 echo ' Etat : <select name="triEtat">';
  35.                 foreach ($listeEtat as $key=>$value)
  36.                 {
  37.                     $selected = ($_POST['triEtat'] == $key)?'selected':'';
  38.                     echo '<option value="'.$key.'" '.$selected.'>'.$value.'</option>';
  39.                 }
  40.                 echo '</select>';
  41.                 $listeStat=array("Tous"=>"Tous","Simulé"=>"Simulé","Validé"=>"Validé" );
  42.                 echo ' Statut : <select name="triStat">';
  43.                 foreach ($listeStat as $key=>$value)
  44.                 {
  45.                     $selected = ($_POST['triStat'] == $key)?'selected':'';
  46.                     echo '<option value="'.$key.'" '.$selected.'>'.$value.'</option>';
  47.                 }
  48.                 echo '</select>';
  49.             ?>
  50.       </td>
  51.     </tr>
  52.     <tr>
  53.       <td colspan="6" align="center" bordercolor="#FFFFFF">
  54.           Coefficient entre :
  55.         <input name="triCoefMin" type="text" size=1 maxlength="3"
  56.                     value="<?php if (isset($_POST['triClassif'])) echo $_POST['triCoefMin'];?>">
  57.         et :
  58.         <input name="triCoefMax" type="text" size=1 maxlength="3"
  59.                     value="<?php if (isset($_POST['triClassif'])) echo $_POST['triCoefMax'];?>">
  60.         Point HAY entre :
  61.         <input name="triHAYMin" type="text" size=1 maxlength="3"
  62.                     value="<?php if (isset($_POST['triClassif'])) echo $_POST['triHAYMin'];?>">
  63.         et :
  64.         <input name="triHAYMax" type="text" size=1 maxlength="3"
  65.                     value="<?php if (isset($_POST['triClassif'])) echo $_POST['triHAYMax'];?>">
  66.         <?php
  67.                 if (isset($_POST['triClassif']) && $_POST['triClassif'] == 'Cadre')
  68.                 {
  69.                     $listeClasse=array("A"=>"A","B"=>"B","C"=>"C","D"=>"D","E"=>"E","F"=>"F","G"=>"G" );
  70.                     echo 'Classe : <select name="triClassMin">';
  71.                     foreach ($listeClasse as $key=>$value)
  72.                     {
  73.                         $selected = ($_POST['triClassMin'] == $key)?'selected':'';
  74.                         echo '<option value="'.$key.'" '.$selected.'>'.$value.'</option>';
  75.                     }
  76.                     echo '</select>';
  77.                     $listeClasseR=array("G"=>"G","F"=>"F","E"=>"E","D"=>"D","C"=>"C","B"=>"B","A"=>"A" );
  78.                     echo 'à : <select name="triClassMax">';
  79.                     foreach ($listeClasseR as $key=>$value)
  80.                     {
  81.                         $selected = ($_POST['triClassMax'] == $key)?'selected':'';
  82.                         echo '<option value="'.$key.'" '.$selected.'>'.$value.'</option>';
  83.                     }
  84.                     echo '</select>';
  85.                 }
  86.                 else if (isset($_POST['triClassif']) && $_POST['triClassif'] == 'Non Cadre')
  87.                 {
  88.                     $listeGroupe=array("I"=>"I","II"=>"II","III"=>"III","IV"=>"IV","V"=>"V","VI"=>"VI","VII"=>"VII" );
  89.                     echo 'Groupe : <select name="triClassMin">';
  90.                     foreach ($listeGroupe as $key=>$value)
  91.                     {
  92.                         $selected = ($_POST['triClassMin'] == $key)?'selected':'';
  93.                         echo '<option value="'.$key.'" '.$selected.'>'.$value.'</option>';
  94.                     }
  95.                     echo '</select>';
  96.                     $listeGroupeR=array("VII"=>"VII","VI"=>"VI","V"=>"V","IV"=>"IV","III"=>"III","II"=>"II","I" =>"I" );
  97.                     echo 'à : <select name="triClassMax">';
  98.                     foreach ($listeGroupeR as $key=>$value)
  99.                     {
  100.                         $selected = ($_POST['triClassMax'] == $key)?'selected':'';
  101.                         echo '<option value="'.$key.'" '.$selected.'>'.$value.'</option>';
  102.                     }
  103.                     echo '</select>';
  104.                 }
  105.         ?>
  106.       </td>
  107.     </tr>
  108.     <tr align="center">
  109.       <td align="center" bordercolor="#FFFFFF"><input type="submit" name="ok" value="Ok"></td>
  110.     </tr>
  111.   </table>
  112. </form>
  113. <?php
  114. }
  115. if (isset($_POST["ok"]))
  116. {
  117.     $select = 'SELECT * FROM poste where';
  118.     if ($_POST['triCoefMin'] == '' && $_POST['triCoefMax'] == '')
  119.         $select .= 'Coef between 0 and 1000';
  120.     else if ($_POST['triCoefMin'] <> '' && !is_numeric($_POST['triCoefMin']))
  121.         {alert("Le coefficient minimum doit être un chiffre!" );
  122.         retour();}
  123.     else if ($_POST['triCoefMax'] <> '' && !is_numeric($_POST['triCoefMax']))
  124.         {alert("Le coefficient maximum doit être un chiffre!" );
  125.         retour();}
  126.     else if ($_POST['triCoefMin'] <> '' && $_POST['triCoefMax'] <> '' && $_POST['triCoefMin'] > $_POST['triCoefMax'])
  127.         {alert("Le coefficient minimum doit être inférieur au coefficient maximum!" );
  128.         retour();}
  129.     else if ($_POST['triCoefMin'] <> '' && $_POST['triCoefMax'] == '')
  130.         $select .= ' Coef="'.$_POST['triCoefMin'].'"';
  131.     else if ($_POST['triCoefMax'] <> '' && $_POST['triCoefMin'] == '')
  132.         $select .= ' Coef="'.$_POST['triCoefMax'].'"';
  133.     else if ($_POST['triCoefMin'] <> '' && $_POST['triCoefMax'] <> '')
  134.         $select .= ' Coef between "'.$_POST['triCoefMin'].'" and "'.$_POST['triCoefMax'].'"';
  135.     if ($_POST['triClassif'] == 'Cadre')
  136.         $select .= ' and Classification="Cadre"';
  137.     if ($_POST['triClassif'] == 'Non Cadre')
  138.         $select .= ' and Classification="Non Cadre"';
  139.     if ($_POST['triEtat'] == 'Actif')
  140.         $select .= ' and Etat="Actif"';
  141.     if ($_POST['triEtat'] == 'Non Actif')
  142.         $select .= ' and Etat="Non Actif"';
  143.     if ($_POST['triStat'] == 'Simulé')
  144.         $select .= ' and Statut="Simulé"';
  145.     if ($_POST['triStat'] == 'Validé')
  146.         $select .= ' and Statut="Validé"';
  147.     if ($_POST['triHayMin'] <> '' && !is_numeric($_POST['triHayMin']))
  148.         {alert("Le total HAY minimum doit être un chiffre!" );
  149.         retour();}
  150.     else if ($_POST['triHayMax'] <> '' && !is_numeric($_POST['triHayMax']))
  151.         {alert("Le total HAY maximum doit être un chiffre!" );
  152.         retour();}
  153.     else if ($_POST['triHayMin'] <> '' && $_POST['triHayMax'] <> '' && $_POST['triHayMin'] > $_POST['triHayMax'])
  154.         {alert("Le total HAY minimum doit être inférieur au total HAY maximum!" );
  155.         retour();}
  156.     else if ($_POST['triHAYMin'] <> '' && $_POST['triHAYMax'] == '')
  157.         $select .= ' and Total='.$_POST['triHAYMin'];
  158.     else if ($_POST['triHAYMax'] <> '' && $_POST['triHAYMin'] == '')
  159.         $select .= ' and Total='.$_POST['triHAYMax'];
  160.     else if ($_POST['triHAYMin'] <> '' && $_POST['triHAYMax'] <> '')
  161.         $select .= ' and Total between '.$_POST['triHAYMin'].' and '.$_POST['triHAYMax'];
  162.     if (isset($_POST['triClassMin']) || $_POST['triClassMax'])
  163.         $select .= ' and Classement between "'.$_POST['triClassMin'].'" and "'.$_POST['triClassMax'].'"';
  164.     $select .= ' order by Total desc';
  165. }
  166. else
  167.     // requête SQL qui compte le nombre total d'enregistrement dans la table et qui récupère tous les enregistrements    
  168.     $select = 'SELECT * FROM poste order by Total desc';
  169.     echo $select;
  170.     $result = mysql_query($select, $link);
  171.     echo $result;
  172.     $total = mysql_num_rows($result);
  173.     echo $total;
  174. if($total)
  175. {
  176.     while ($row = mysql_fetch_array($result))
  177.       {
  178.            if ($row['Direction'] == "DC" && ($row['Classement'] == "VII" || $row['Classement'] == "G" ))
  179.              $txtDCG .= $row['NumDP']."&nbsp;".$row['Intitule']."&nbsp;".$row['Total']."&nbsp;".$row['Coef']."<BR>";
  180.         if ($row['Direction'] == "DG" && ($row['Classement'] == "VII" || $row['Classement'] == "G" ))
  181.             $txtDGG .= $row['NumDP']."&nbsp;".$row['Intitule']."&nbsp;".$row['Total']."&nbsp;".$row['Coef']."<BR>";
  182.         if ($row['Direction'] == "DLM" && ($row['Classement'] == "VII" || $row['Classement'] == "G" ))
  183.             $txtDLMG .= $row['NumDP']."&nbsp;".$row['Intitule']."&nbsp;".$row['Total']."&nbsp;".$row['Coef']."<BR>";
  184.         if ($row['Direction'] == "DO" && ($row['Classement'] == "VII" || $row['Classement'] == "G" ))
  185.             $txtDOG .= $row['NumDP']."&nbsp;".$row['Intitule']."&nbsp;".$row['Total']."&nbsp;".$row['Coef']."<BR>";
  186.         if ($row['Direction'] == "DT" && ($row['Classement'] == "VII" || $row['Classement'] == "G" ))
  187.             $txtDTG .= $row['NumDP']."&nbsp;".$row['Intitule']."&nbsp;".$row['Total']."&nbsp;".$row['Coef']."<BR>";
  188.         if ($row['Direction'] == "INFO" && ($row['Classement'] == "VII" || $row['Classement'] == "G" ))
  189.             $txtINFOG .= $row['NumDP']."&nbsp;".$row['Intitule']."&nbsp;".$row['Total']."&nbsp;".$row['Coef']."<BR>";
  190.         if ($row['Direction'] == "MKG" && ($row['Classement'] == "VII" || $row['Classement'] == "G" ))
  191.             $txtMKGG .= $row['NumDP']."&nbsp;".$row['Intitule']."&nbsp;".$row['Total']."&nbsp;".$row['Coef']."<BR>";
  192.         if ($row['Direction'] == "RH" && ($row['Classement'] == "VII" || $row['Classement'] == "G" ))
  193.             $txtRHG .= $row['NumDP']."&nbsp;".$row['Intitule']."&nbsp;".$row['Total']."&nbsp;".$row['Coef']."<BR>"; 
  194.         if ($row['Direction'] == "SG" && ($row['Classement'] == "VII" || $row['Classement'] == "G" ))
  195.             $txtSGG .= $row['NumDP']."&nbsp;".$row['Intitule']."&nbsp;".$row['Total']."&nbsp;".$row['Coef']."<BR>";
  196.         /***********************************************************************************************/
  197.         if ($row['Direction'] == "DC" && ($row['Classement'] == "VI" || $row['Classement'] == "F" ))
  198.              $txtDCF .= $row['NumDP']."&nbsp;".$row['Intitule']." - ".$row['Total']." - ".$row['Coef']."<BR>";
  199.         if ($row['Direction'] == "DG" && ($row['Classement'] == "VI" || $row['Classement'] == "F" ))
  200.             $txtDGF .= $row['NumDP']."&nbsp;".$row['Intitule']."&nbsp;".$row['Total']."&nbsp;".$row['Coef']."<BR>";
  201.         if ($row['Direction'] == "DLM" && ($row['Classement'] == "VI" || $row['Classement'] == "F" ))
  202.             $txtDLMF .= $row['NumDP']."&nbsp;".$row['Intitule']."&nbsp;".$row['Total']."&nbsp;".$row['Coef']."<BR>";
  203.         if ($row['Direction'] == "DO" && ($row['Classement'] == "VI" || $row['Classement'] == "F" ))
  204.             $txtDOF .= $row['NumDP']."&nbsp;".$row['Intitule']."&nbsp;".$row['Total']."&nbsp;".$row['Coef']."<BR>";
  205.         if ($row['Direction'] == "DT" && ($row['Classement'] == "VI" || $row['Classement'] == "F" ))
  206.             $txtDTF .= $row['NumDP']."&nbsp;".$row['Intitule']."&nbsp;".$row['Total']."&nbsp;".$row['Coef']."<BR>";
  207.         if ($row['Direction'] == "INFO" && ($row['Classement'] == "VI" || $row['Classement'] == "F" ))
  208.             $txtINFOF .= $row['NumDP']."&nbsp;".$row['Intitule']."&nbsp;".$row['Total']."&nbsp;".$row['Coef']."<BR>";
  209.         if ($row['Direction'] == "MKG" && ($row['Classement'] == "VI" || $row['Classement'] == "F" ))
  210.             $txtMKGF .= $row['NumDP']."&nbsp;".$row['Intitule']."&nbsp;".$row['Total']."&nbsp;".$row['Coef']."<BR>";
  211.         if ($row['Direction'] == "RH" && ($row['Classement'] == "VI" || $row['Classement'] == "F" ))
  212.             $txtRHF .= $row['NumDP']."&nbsp;".$row['Intitule']."&nbsp;".$row['Total']."&nbsp;".$row['Coef']."<BR>"; 
  213.         if ($row['Direction'] == "SG" && ($row['Classement'] == "VI" || $row['Classement'] == "F" ))
  214.             $txtSGF .= $row['NumDP']."&nbsp;".$row['Intitule']."&nbsp;".$row['Total']."&nbsp;".$row['Coef']."<BR>";
  215.         /***********************************************************************************************/
  216.         if ($row['Direction'] == "DC" && ($row['Classement'] == "V" || $row['Classement'] == "E" ))
  217.              $txtDCE .= $row['NumDP']."&nbsp;".$row['Intitule']." - ".$row['Total']." - ".$row['Coef']."<BR>";
  218.         if ($row['Direction'] == "DG" && ($row['Classement'] == "V" || $row['Classement'] == "E" ))
  219.             $txtDGE .= $row['NumDP']."&nbsp;".$row['Intitule']."&nbsp;".$row['Total']."&nbsp;".$row['Coef']."<BR>";
  220.         if ($row['Direction'] == "DLM" && ($row['Classement'] == "V" || $row['Classement'] == "E" ))
  221.             $txtDLME .= $row['NumDP']."&nbsp;".$row['Intitule']."&nbsp;".$row['Total']."&nbsp;".$row['Coef']."<BR>";
  222.         if ($row['Direction'] == "DO" && ($row['Classement'] == "V" || $row['Classement'] == "E" ))
  223.             $txtDOE .= $row['NumDP']."&nbsp;".$row['Intitule']."&nbsp;".$row['Total']."&nbsp;".$row['Coef']."<BR>";
  224.         if ($row['Direction'] == "DT" && ($row['Classement'] == "V" || $row['Classement'] == "E" ))
  225.             $txtDTE .= $row['NumDP']."&nbsp;".$row['Intitule']."&nbsp;".$row['Total']."&nbsp;".$row['Coef']."<BR>";
  226.         if ($row['Direction'] == "INFO" && ($row['Classement'] == "V" || $row['Classement'] == "E" ))
  227.             $txtINFOE .= $row['NumDP']."&nbsp;".$row['Intitule']."&nbsp;".$row['Total']."&nbsp;".$row['Coef']."<BR>";
  228.         if ($row['Direction'] == "MKG" && ($row['Classement'] == "V" || $row['Classement'] == "E" ))
  229.             $txtMKGE .= $row['NumDP']."&nbsp;".$row['Intitule']."&nbsp;".$row['Total']."&nbsp;".$row['Coef']."<BR>";
  230.         if ($row['Direction'] == "RH" && ($row['Classement'] == "V" || $row['Classement'] == "E" ))
  231.             $txtRHE .= $row['NumDP']."&nbsp;".$row['Intitule']."&nbsp;".$row['Total']."&nbsp;".$row['Coef']."<BR>";
  232.         if ($row['Direction'] == "SG" && ($row['Classement'] == "V" || $row['Classement'] == "E" ))
  233.             $txtSGE .= $row['NumDP']."&nbsp;".$row['Intitule']."&nbsp;".$row['Total']."&nbsp;".$row['Coef']."<BR>";
  234.         /***********************************************************************************************/
  235.         if ($row['Direction'] == "DC" && ($row['Classement'] == "IV" || $row['Classement'] == "D" ))
  236.              $txtDCD .= $row['NumDP']."&nbsp;".$row['Intitule']."&nbsp;".$row['Total']."&nbsp;".$row['Coef']."<BR>";
  237.         if ($row['Direction'] == "DG" && ($row['Classement'] == "IV" || $row['Classement'] == "D" ))
  238.             $txtDGD .= $row['NumDP']."&nbsp;".$row['Intitule']."&nbsp;".$row['Total']."&nbsp;".$row['Coef']."<BR>";
  239.         if ($row['Direction'] == "DLM" && ($row['Classement'] == "IV" || $row['Classement'] == "D" ))
  240.             $txtDLMD .= $row['NumDP']."&nbsp;".$row['Intitule']."&nbsp;".$row['Total']."&nbsp;".$row['Coef']."<BR>";
  241.         if ($row['Direction'] == "DO" && ($row['Classement'] == "IV" || $row['Classement'] == "D" ))
  242.             $txtDOD .= $row['NumDP']."&nbsp;".$row['Intitule']."&nbsp;".$row['Total']."&nbsp;".$row['Coef']."<BR>";
  243.         if ($row['Direction'] == "DT" && ($row['Classement'] == "IV" || $row['Classement'] == "D" ))
  244.             $txtDTD .= $row['NumDP']."&nbsp;".$row['Intitule']."&nbsp;".$row['Total']."&nbsp;".$row['Coef']."<BR>";
  245.         if ($row['Direction'] == "INFO" && ($row['Classement'] == "IV" || $row['Classement'] == "D" ))
  246.             $txtINFOD .= $row['NumDP']."&nbsp;".$row['Intitule']."&nbsp;".$row['Total']."&nbsp;".$row['Coef']."<BR>";
  247.         if ($row['Direction'] == "MKG" && ($row['Classement'] == "IV" || $row['Classement'] == "D" ))
  248.             $txtMKGD .= $row['NumDP']."&nbsp;".$row['Intitule']."&nbsp;".$row['Total']."&nbsp;".$row['Coef']."<BR>";
  249.         if ($row['Direction'] == "RH" && ($row['Classement'] == "IV" || $row['Classement'] == "D" ))
  250.             $txtRHD .= $row['NumDP']."&nbsp;".$row['Intitule']."&nbsp;".$row['Total']."&nbsp;".$row['Coef']."<BR>";
  251.         if ($row['Direction'] == "SG" && ($row['Classement'] == "IV" || $row['Classement'] == "D" ))
  252.             $txtSGD .= $row['NumDP']."&nbsp;".$row['Intitule']."&nbsp;".$row['Total']."&nbsp;".$row['Coef']."<BR>";
  253.         /***********************************************************************************************/
  254.         if ($row['Direction'] == "DC" && ($row['Classement'] == "III" || $row['Classement'] == "C" ))
  255.              $txtDCC .= $row['NumDP']."&nbsp;".$row['Intitule']." - ".$row['Total']." - ".$row['Coef']."<BR>";
  256.         if ($row['Direction'] == "DG" && ($row['Classement'] == "III" || $row['Classement'] == "C" ))
  257.             $txtDGC .= $row['NumDP']."&nbsp;".$row['Intitule']."&nbsp;".$row['Total']."&nbsp;".$row['Coef']."<BR>";
  258.         if ($row['Direction'] == "DLM" && ($row['Classement'] == "III" || $row['Classement'] == "C" ))
  259.             $txtDLMC .= $row['NumDP']."&nbsp;".$row['Intitule']."&nbsp;".$row['Total']."&nbsp;".$row['Coef']."<BR>";
  260.         if ($row['Direction'] == "DO" && ($row['Classement'] == "III" || $row['Classement'] == "C" ))
  261.             $txtDOC .= $row['NumDP']."&nbsp;".$row['Intitule']."&nbsp;".$row['Total']."&nbsp;".$row['Coef']."<BR>";
  262.         if ($row['Direction'] == "DT" && ($row['Classement'] == "III" || $row['Classement'] == "C" ))
  263.             $txtDTC .= $row['NumDP']."&nbsp;".$row['Intitule']."&nbsp;".$row['Total']."&nbsp;".$row['Coef']."<BR>";
  264.         if ($row['Direction'] == "INFO" && ($row['Classement'] == "III" || $row['Classement'] == "C" ))
  265.             $txtINFOC .= $row['NumDP']."&nbsp;".$row['Intitule']."&nbsp;".$row['Total']."&nbsp;".$row['Coef']."<BR>";
  266.         if ($row['Direction'] == "MKG" && ($row['Classement'] == "III" || $row['Classement'] == "C" ))
  267.             $txtMKGC .= $row['NumDP']."&nbsp;".$row['Intitule']."&nbsp;".$row['Total']."&nbsp;".$row['Coef']."<BR>";
  268.         if ($row['Direction'] == "RH" && ($row['Classement'] == "III" || $row['Classement'] == "C" ))
  269.             $txtRHC .= $row['NumDP']."&nbsp;".$row['Intitule']."&nbsp;".$row['Total']."&nbsp;".$row['Coef']."<BR>";
  270.         if ($row['Direction'] == "SG" && ($row['Classement'] == "III" || $row['Classement'] == "C" ))
  271.             $txtSGC .= $row['NumDP']."&nbsp;".$row['Intitule']."&nbsp;".$row['Total']."&nbsp;".$row['Coef']."<BR>";
  272.         /***********************************************************************************************/
  273.         if ($row['Direction'] == "DC" && ($row['Classement'] == "II" || $row['Classement'] == "B" ))
  274.              $txtDCB .= $row['NumDP']."&nbsp;".$row['Intitule']." - ".$row['Total']." - ".$row['Coef']."<BR>";
  275.         if ($row['Direction'] == "DG" && ($row['Classement'] == "II" || $row['Classement'] == "B" ))
  276.             $txtDGB .= $row['NumDP']."&nbsp;".$row['Intitule']."&nbsp;".$row['Total']."&nbsp;".$row['Coef']."<BR>";
  277.         if ($row['Direction'] == "DLM" && ($row['Classement'] == "II" || $row['Classement'] == "B" ))
  278.             $txtDLMB .= $row['NumDP']."&nbsp;".$row['Intitule']."&nbsp;".$row['Total']."&nbsp;".$row['Coef']."<BR>";
  279.         if ($row['Direction'] == "DO" && ($row['Classement'] == "II" || $row['Classement'] == "B" ))
  280.             $txtDOB .= $row['NumDP']."&nbsp;".$row['Intitule']."&nbsp;".$row['Total']."&nbsp;".$row['Coef']."<BR>";
  281.         if ($row['Direction'] == "DT" && ($row['Classement'] == "II" || $row['Classement'] == "B" ))
  282.             $txtDTB .= $row['NumDP']."&nbsp;".$row['Intitule']."&nbsp;".$row['Total']."&nbsp;".$row['Coef']."<BR>";
  283.         if ($row['Direction'] == "INFO" && ($row['Classement'] == "II" || $row['Classement'] == "B" ))
  284.             $txtINFOB .= $row['NumDP']."&nbsp;".$row['Intitule']."&nbsp;".$row['Total']."&nbsp;".$row['Coef']."<BR>";
  285.         if ($row['Direction'] == "MKG" && ($row['Classement'] == "II" || $row['Classement'] == "B" ))
  286.             $txtMKGB .= $row['NumDP']."&nbsp;".$row['Intitule']."&nbsp;".$row['Total']."&nbsp;".$row['Coef']."<BR>";
  287.         if ($row['Direction'] == "RH" && ($row['Classement'] == "II" || $row['Classement'] == "B" ))
  288.             $txtRHB .= $row['NumDP']."&nbsp;".$row['Intitule']."&nbsp;".$row['Total']."&nbsp;".$row['Coef']."<BR>";
  289.         if ($row['Direction'] == "SG" && ($row['Classement'] == "II" || $row['Classement'] == "B" ))
  290.             $txtSGB .= $row['NumDP']."&nbsp;".$row['Intitule']."&nbsp;".$row['Total']."&nbsp;".$row['Coef']."<BR>";
  291.         /***********************************************************************************************/
  292.         if ($row['Direction'] == "DC" && ($row['Classement'] == "I" || $row['Classement'] == "A" ))
  293.              $txtDCA .= $row['NumDP']."&nbsp;".$row['Intitule']." - ".$row['Total']." - ".$row['Coef']."<BR>";
  294.         if ($row['Direction'] == "DG" && ($row['Classement'] == "I" || $row['Classement'] == "A" ))
  295.             $txtDGA .= $row['NumDP']."&nbsp;".$row['Intitule']."&nbsp;".$row['Total']."&nbsp;".$row['Coef']."<BR>";
  296.         if ($row['Direction'] == "DLM" && ($row['Classement'] == "I" || $row['Classement'] == "A" ))
  297.             $txtDLMA .= $row['NumDP']."&nbsp;".$row['Intitule']."&nbsp;".$row['Total']."&nbsp;".$row['Coef']."<BR>";
  298.         if ($row['Direction'] == "DO" && ($row['Classement'] == "I" || $row['Classement'] == "A" ))
  299.             $txtDOA .= $row['NumDP']."&nbsp;".$row['Intitule']."&nbsp;".$row['Total']."&nbsp;".$row['Coef']."<BR>";
  300.         if ($row['Direction'] == "DT" && ($row['Classement'] == "I" || $row['Classement'] == "A" ))
  301.             $txtDTA .= $row['NumDP']."&nbsp;".$row['Intitule']."&nbsp;".$row['Total']."&nbsp;".$row['Coef']."<BR>";
  302.         if ($row['Direction'] == "INFO" && ($row['Classement'] == "I" || $row['Classement'] == "A" ))
  303.             $txtINFOA .= $row['NumDP']."&nbsp;".$row['Intitule']."&nbsp;".$row['Total']."&nbsp;".$row['Coef']."<BR>";
  304.         if ($row['Direction'] == "MKG" && ($row['Classement'] == "I" || $row['Classement'] == "A" ))
  305.             $txtMKGA .= $row['NumDP']."&nbsp;".$row['Intitule']."&nbsp;".$row['Total']."&nbsp;".$row['Coef']."<BR>";
  306.         if ($row['Direction'] == "RH" && ($row['Classement'] == "I" || $row['Classement'] == "A" ))
  307.             $txtRHA .= $row['NumDP']."&nbsp;".$row['Intitule']."&nbsp;".$row['Total']."&nbsp;".$row['Coef']."<BR>";
  308.         if ($row['Direction'] == "SG" && ($row['Classement'] == "I" || $row['Classement'] == "A" ))
  309.             $txtSGA .= $row['NumDP']."&nbsp;".$row['Intitule']."&nbsp;".$row['Total']."&nbsp;".$row['Coef']."<BR>";
  310.     }
  311. }
  312. ?>
  313. <form name="tableau" method="post" action="">
  314.   <table width="1000" align="center" border="1" cellspacing="0" cellpadding="1">
  315.     <caption align="center" style="border:double">
  316.     Légende :<br />
  317.     N°DP Intitulé Points Hay Coefficient
  318.     <tr>
  319.       <th scope="col">&nbsp;</th>
  320.       <th scope="col">DC</th>
  321.       <th scope="col">DG</th>
  322.       <th scope="col">DLM</th>
  323.       <th scope="col">DO</th>
  324.       <th scope="col">DT</th>
  325.       <th scope="col">INFO</th>
  326.       <th scope="col">MKG</th>
  327.       <th scope="col">RH</th>
  328.       <th scope="col">SG</th>
  329.     </tr>
  330.     <tr>
  331.       <th scope="row"><?php if (isset($_POST['triClassif']) && $_POST['triClassif'] == 'Non Cadre') echo "VII";
  332.                       else if (isset($_POST['triClassif']) && $_POST['triClassif'] == 'Cadre') echo "G";
  333.                       else echo "&nbsp;";?>
  334.       </th>
  335.       <td><?php if (isset($txtDCG)) echo $txtDCG; else echo "&nbsp;";?></td>
  336.       <td><?php if (isset($txtDGG)) echo $txtDGG; else echo "&nbsp;";?></td>
  337.       <td><?php if (isset($txtDLMG)) echo $txtDLMG; else echo "&nbsp;";?></td>
  338.       <td><?php if (isset($txtDOG)) echo $txtDOG; else echo "&nbsp;";?></td>
  339.       <td><?php if (isset($txtDTG)) echo $txtDTG; else echo "&nbsp;";?></td>
  340.       <td><?php if (isset($txtINFOG)) echo $txtINFOG; else echo "&nbsp;";?></td>
  341.       <td><?php if (isset($txtMKGG)) echo $txtMKGG; else echo "&nbsp;";?></td>
  342.       <td><?php if (isset($txtRHG)) echo $txtRHG; else echo "&nbsp;";?></td>
  343.       <td><?php if (isset($txtSGG)) echo $txtSGCG; else echo "&nbsp;";?></td>
  344.     </tr>
  345.     <tr>
  346.       <th scope="row"><?php if (isset($_POST['triClassif']) && $_POST['triClassif'] == 'Non Cadre') echo "VI";
  347.                       else if (isset($_POST['triClassif']) && $_POST['triClassif'] == 'Cadre') echo "F";
  348.                       else echo "&nbsp;";?>
  349.       </th>
  350.       <td><?php if (isset($txtDCF)) echo $txtDCF; else echo "&nbsp;";?></td>
  351.       <td><?php if (isset($txtDGF)) echo $txtDGF; else echo "&nbsp;";?></td>
  352.       <td><?php if (isset($txtDLMF)) echo $txtDLMF; else echo "&nbsp;";?></td>
  353.       <td><?php if (isset($txtDOF)) echo $txtDOF; else echo "&nbsp;";?></td>
  354.       <td><?php if (isset($txtDTF)) echo $txtDTF; else echo "&nbsp;";?></td>
  355.       <td><?php if (isset($txtINFOF)) echo $txtINFOF; else echo "&nbsp;";?></td>
  356.       <td><?php if (isset($txtMKGF)) echo $txtMKGF; else echo "&nbsp;";?></td>
  357.       <td><?php if (isset($txtRHF)) echo $txtRHF; else echo "&nbsp;";?></td>
  358.       <td><?php if (isset($txtSGF)) echo $txtSGCF; else echo "&nbsp;";?></td>
  359.     </tr>
  360.     <tr>
  361.       <th scope="row"><?php if (isset($_POST['triClassif']) && $_POST['triClassif'] == 'Non Cadre') echo "V";
  362.                       else if (isset($_POST['triClassif']) && $_POST['triClassif'] == 'Cadre') echo "E";
  363.                       else echo "&nbsp;";?>
  364.       </th>
  365.       <td><?php if (isset($txtDCE)) echo $txtDCE; else echo "&nbsp;";?></td>
  366.       <td><?php if (isset($txtDGE)) echo $txtDGE; else echo "&nbsp;";?></td>
  367.       <td><?php if (isset($txtDLME)) echo $txtDLME; else echo "&nbsp;";?></td>
  368.       <td><?php if (isset($txtDOE)) echo $txtDOE; else echo "&nbsp;";?></td>
  369.       <td><?php if (isset($txtDTE)) echo $txtDTE; else echo "&nbsp;";?></td>
  370.       <td><?php if (isset($txtINFOE)) echo $txtINFOE; else echo "&nbsp;";?></td>
  371.       <td><?php if (isset($txtMKGE)) echo $txtMKGE; else echo "&nbsp;";?></td>
  372.       <td><?php if (isset($txtRHE)) echo $txtRHE; else echo "&nbsp;";?></td>
  373.       <td><?php if (isset($txtSGE)) echo $txtSGCE; else echo "&nbsp;";?></td>
  374.     </tr>
  375.     <tr>
  376.       <th scope="row"><?php if (isset($_POST['triClassif']) && $_POST['triClassif'] == 'Non Cadre') echo "IV";
  377.                       else if (isset($_POST['triClassif']) && $_POST['triClassif'] == 'Cadre') echo "D";
  378.                       else echo "&nbsp;";?>
  379.       </th>
  380.       <td><?php if (isset($txtDCD)) echo $txtDCD; else echo "&nbsp;";?></td>
  381.       <td><?php if (isset($txtDGD)) echo $txtDGD; else echo "&nbsp;";?></td>
  382.       <td><?php if (isset ($txtDLMD)) echo $txtDLMD; else echo "&nbsp;";?></td> 
  383.       <td><?php if (isset ($txtDOD)) echo $txtDOD; else echo "&nbsp;";?></td>
  384.       <td><?php if (isset($txtDTD)) echo $txtDTD; else echo "&nbsp;";?></td>
  385.       <td><?php if (isset($txtINFOD)) echo $txtINFOD; else echo "&nbsp;";?></td>
  386.       <td><?php if (isset($txtMKGD)) echo $txtMKGD; else echo "&nbsp;";?></td>
  387.       <td><?php if (isset($txtRHD)) echo $txtRHD; else echo "&nbsp;";?></td>
  388.       <td><?php if (isset($txtSGD)) echo $txtSGCD; else echo "&nbsp;";?></td>
  389.     </tr>
  390.     <tr>
  391.       <th scope="row"><?php if (isset($_POST['triClassif']) && $_POST['triClassif'] == 'Non Cadre') echo "III";
  392.                       else if (isset($_POST['triClassif']) && $_POST['triClassif'] == 'Cadre') echo "C";
  393.                       else echo "&nbsp;";?>
  394.       </th>
  395.       <td><?php if (isset($txtDCC)) echo $txtDCC; else echo "&nbsp;";?></td>
  396.       <td><?php if (isset($txtDGC)) echo $txtDGC; else echo "&nbsp;";?></td>
  397.       <td><?php if (isset($txtDLMC)) echo $txtDLMC; else echo "&nbsp;";?></td>
  398.       <td><?php if (isset($txtDOC)) echo $txtDOC; else echo "&nbsp;";?></td>
  399.       <td><?php if (isset($txtDTC)) echo $txtDTC; else echo "&nbsp;";?></td>
  400.       <td><?php if (isset($txtINFOC)) echo $txtINFOC; else echo "&nbsp;";?></td>
  401.       <td><?php if (isset($txtMKGC)) echo $txtMKGC; else echo "&nbsp;";?></td>
  402.       <td><?php if (isset($txtRHC)) echo $txtRHC; else echo "&nbsp;";?></td>
  403.       <td><?php if (isset($txtSGC)) echo $txtSGCC; else echo "&nbsp;";?></td>
  404.     </tr>
  405.     <tr>
  406.       <th scope="row"><?php if (isset($_POST['triClassif']) && $_POST['triClassif'] == 'Non Cadre') echo "II";
  407.                       else if (isset($_POST['triClassif']) && $_POST['triClassif'] == 'Cadre') echo "B";
  408.                       else echo "&nbsp;";?>
  409.       </th>
  410.       <td><?php if (isset($txtDCB)) echo $txtDCB; else echo "&nbsp;";?></td>
  411.       <td><?php if (isset($txtDGB)) echo $txtDGB; else echo "&nbsp;";?></td>
  412.       <td><?php if (isset($txtDLMB)) echo $txtDLMB; else echo "&nbsp;";?></td>
  413.       <td><?php if (isset($txtDOB)) echo $txtDOB; else echo "&nbsp;";?></td>
  414.       <td><?php if (isset($txtDTB)) echo $txtDTB; else echo "&nbsp;";?></td>
  415.       <td><?php if (isset($txtINFOB)) echo $txtINFOB; else echo "&nbsp;";?></td>
  416.       <td><?php if (isset($txtMKGB)) echo $txtMKGB; else echo "&nbsp;";?></td>
  417.       <td><?php if (isset($txtRHB)) echo $txtRHB; else echo "&nbsp;";?></td>
  418.       <td><?php if (isset($txtSGB)) echo $txtSGCB; else echo "&nbsp;";?></td>
  419.     </tr>
  420.     <tr>
  421.       <th scope="row"><?php if (isset($_POST['triClassif']) && $_POST['triClassif'] == 'Non Cadre') echo "I";
  422.                       else if (isset($_POST['triClassif']) && $_POST['triClassif'] == 'Cadre') echo "A";
  423.                       else echo "&nbsp;";?>
  424.       </th>
  425.       <td><?php if (isset($txtDCA)) echo $txtDCA; else echo "&nbsp;";?></td>
  426.       <td><?php if (isset($txtDGA)) echo $txtDGA; else echo "&nbsp;";?></td>
  427.       <td><?php if (isset($txtDLMA)) echo $txtDLMA; else echo "&nbsp;";?></td>
  428.       <td><?php if (isset($txtDOA)) echo $txtDOA; else echo "&nbsp;";?></td>
  429.       <td><?php if (isset($txtDTA)) echo $txtDTA; else echo "&nbsp;";?></td>
  430.       <td><?php if (isset($txtINFOA)) echo $txtINFOA; else echo "&nbsp;";?></td>
  431.       <td><?php if (isset($txtMKGA)) echo $txtMKGA; else echo "&nbsp;";?></td>
  432.       <td><?php if (isset($txtRHA)) echo $txtRHA; else echo "&nbsp;";?></td>
  433.       <td><?php if (isset($txtSGA)) echo $txtSGCA; else echo "&nbsp;";?></td>
  434.     </tr>
  435.    
  436.     <?php if (!$_GET['print']){?>
  437.     <tr align="center">
  438.       <td colspan="10"><input name="printtab" type="submit" value="Imprimer le tableau"
  439.     onclick="window.document.tableau.action='tableau.php?print=TRUE';"></td>
  440.     </tr>
  441.     <?php
  442.     }
  443.     ?>
  444.   </table>
  445. </form>
  446. <?php
  447. if ($_GET['print']) { echo '<div align="center"><a href="tableau.php">Revenir au tableau de répartition</a></div>'; imprimer();}
  448. if (!$_GET['print']) include ("_btm.php" );
  449. ?>




Merci bien de prendre du temps pour moi.


Message édité par Bruenor911 le 09-04-2008 à 16:30:50
Répondre à Bruenor911

ligne 124: espace entre ' et C
ou mieux lg 122 espace après le where

------------------------------ Ne pas oublier le [resolu] pour finir le sujet.
Penser à voir les tutos, ca peut aider!
Répondre à coca25

En plus t'as pas fait l'erreur apres :

 
Code :
  1. .        $select .= 'Coef between 0 and 1000'; // ligne 124 sur ton post
  2. .        $select .= ' Coef="'.$_POST['triCoefMin'].'"'; //ligne 135 sur ton post
 
Spoiler :

J'en profite pour dire bonjour à coca25 ! Ça va m'sieur ? :D


Message édité par RedTux le 09-04-2008 à 16:53:21
------------------------------ N'oubliez pas le [Résolu] dans le titre si vous êtes satisfait.
Les règles du Forum - À lire absolument
Répondre à RedTux

:jap: zen, tranquille

 

bon retour (t'avais disparu des écrans :))

Message cité 1 fois
Message édité par coca25 le 09-04-2008 à 17:38:02
------------------------------ Ne pas oublier le [resolu] pour finir le sujet.
Penser à voir les tutos, ca peut aider!
Répondre à coca25

coca25 a écrit :

bon retour (t'avais disparu des écrans :))



C'est pas un vrai retour ... Je m'ennuie un peu au taff donc je passe voir ce qu'y ce passe ...

Spoiler :

IDN's lover ... snif ... [:zoon62:2]

------------------------------ N'oubliez pas le [Résolu] dans le titre si vous êtes satisfait.
Les règles du Forum - À lire absolument
Répondre à RedTux

Merci beaucoup, ça m'aide vraiment et peut-être qu'à force je serais moins nul.

Répondre à Bruenor911
Tom's Guide > Forum > Programmation > Pb php requête base de données [Résolu]
Aller à :

Il y a 417 utilisateurs connus et inconnus. Pour voir la liste des connectés connus, cliquez ici.

Attention

Vous allez répondre sur un sujet resté inactif pendant plus de 6 mois.
Assurez-vous d'apporter des éléments nouveaux à la discussion avant de poursuivre.

Répondre Annuler
Liens