IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

PHP & Base de données Discussion :

Calcul par matière / module


Sujet :

PHP & Base de données

  1. #81
    FoxLeRenard
    Invité(e)
    Par défaut
    Citation Envoyé par lilia_dream Voir le message
    Merci FoxLeRenard

    le script du selection1.php

    le script du selection2.php il y a une erreur

    Merci de nouveau
    Si tu avais gardé telquel mon code, la ligne 61 serait
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
     
        $nommod= stripslashes($row['nommod']);
    Tu as changé quoi ??
    en tout cas peux tu juste modifier dans selection2.php

    en début
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
     
    <?PHP
    session_start();
    /* selection2.php */
    if (isset($_POST["module"])) $module=htmlentities(trim($_POST["module"]));
        else $module="xx";
     
    echo "".$module."<br />";
     
    ?>

  2. #82
    FoxLeRenard
    Invité(e)
    Par défaut
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
     
    echo "".$module."<br />";
    il te réponds quoi ?
    bien sur l'erreur est toujours la mais ce qui m'intéresse c'est que contient le POST

  3. #83
    Membre du Club Avatar de lilia_dream
    Inscrit en
    Mars 2009
    Messages
    267
    Détails du profil
    Informations forums :
    Inscription : Mars 2009
    Messages : 267
    Points : 43
    Points
    43
    Par défaut
    je n'ai change que les lignes de connexion de BDD

    Mais est le même.

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
     
    <?PHP
    session_start();
    /* selection2.php */
    if (isset($_POST["module"])) $module=htmlentities(trim($_POST["module"]));
        else $module="xx";
     
    echo "".$module."<br />";
     
    ?>
     
    <!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN'  'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
    <html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'>
    <head>
    <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
    <title>suivi scolaire</title>
    <meta name="keywords" content="suivi scolaire" />
    <meta name="description" content="suivi scolaire" />
    <meta name="robots" content="all" />
    <meta http-equiv="content-language" content="fr, en" />
    <meta name="expires" content="never" />
    <meta name="rating" content="general" />
    <meta name="revisit-after" content="30 days" />
    <style type="text/css">
    * {font-size : 100%;}
    html { width:100%;height : 100%;font-size : 100%;
    }
    BODY {
    width:100%;
    height : 100%;
    background-color : #557bac; 
    font-family : Verdana, Myranda,Arial, Helvetica, sans-serif; 
    font-size : 100%; 
    color : #ffffff; 
    margin-left : 0; 
    margin-right : 0;
    text-align:center;
    }
    div.centre {width: 800px;margin : auto;text-align:center;}
    a.LesA { font-family : Verdana, Myranda,Arial, Helvetica, sans-serif;   font-size: 1.2em; color: #ffffff; text-decoration: none;}
    a.LesA:link { } 
    a.LesA:hover {color : #ff9999; }
    </style>
     
    </head>
    <body>
     
    <div class="centre" >
    <b>JUSTE CONTROLE</b><br />
    <table><tr><td>
     
    <?PHP
    /* <form method='post' action='selection1.php'><br /> */
    if ($module=="xx") 
    echo "saisie incorecte";
    else
      {
    // ------------------------------------------------------
    // connexion a la BD
    	include("connexion.php");
    // ------------------------------------------------------
     
       $result=mysql_query("select * from module
         WHERE  Index = '$module'");
       while ($row=mysql_fetch_array($result)) 
         {
          $Index= stripslashes($row['Index']);
          $nommod= stripslashes($row['nommod']);
     
          echo "Oui saisie ".$Index." ".$nommod."<br /> ";
         }
       mysql_close();
       }
    /*
    <br /><input type='submit' value='ok'>
    </form>
    */
    ?>
     
    </td></tr></table>
    <br />
    </div>
     
    </body></html>
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
     
    Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in d:\documents and settings\testnn\selection2.php on line 64
    l'erreur existe mais il retourne le POST
    Merci d'avance

  4. #84
    FoxLeRenard
    Invité(e)
    Par défaut
    Bon affiches moi la réponse du POST car je crains que comme je l'ais écris, il renvoie "18" au lieu de 18 ??

    Autre constat puisque dans le 1 ta connection marchait , c'est la même sur le 2 ... donc controle l'orthographe et CAST de cette patie
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
     
    $result=mysql_query("select * from module
         WHERE  Index = '$module'");
       while ($row=mysql_fetch_array($result)) 
         {
          $Index= stripslashes($row['Index']);
          $nommod= stripslashes($row['nommod']);
     
          echo "Oui saisie ".$Index." ".$nommod."<br /> ";
         }
    Index nommod

  5. #85
    Membre du Club Avatar de lilia_dream
    Inscrit en
    Mars 2009
    Messages
    267
    Détails du profil
    Informations forums :
    Inscription : Mars 2009
    Messages : 267
    Points : 43
    Points
    43
    Par défaut
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
     
    Autre constat puisque dans le 1 ta connection marchait , c'est la même sur le 2
    c'est la meme dans les deux fichiers

  6. #86
    FoxLeRenard
    Invité(e)
    Par défaut
    Vraiment incroyable car les MYSQL sont LES MEMES dans tes deux codes
    mystére !

    de toute façon il faut tester le vrais 2
    que voici
    (donc tu remets ta connection) attention il n'y en a qu'une pour toutes les tables !
    selection2.php
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
     
    <?PHP
    session_start();
    /* selection2.php */
    if (isset($_POST["module"])) $module=htmlentities(trim($_POST["module"]));
        else $module="xx";
    ?>
     
    <!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN'  'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
    <html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'>
    <head>
    <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
    <title>suivi scolaire</title>
    <meta name="keywords" content="suivi scolaire" />
    <meta name="description" content="suivi scolaire" />
    <meta name="robots" content="all" />
    <meta http-equiv="content-language" content="fr, en" />
    <meta name="expires" content="never" />
    <meta name="rating" content="general" />
    <meta name="revisit-after" content="30 days" />
    <style type="text/css">
    * {font-size : 100%;}
    html { width:100%;height : 100%;font-size : 100%;
    }
    BODY {
    width:100%;
    height : 100%;
    background-color : #557bac; 
    font-family : Verdana, Myranda,Arial, Helvetica, sans-serif; 
    font-size : 100%; 
    color : #ffffff; 
    margin-left : 0; 
    margin-right : 0;
    text-align:center;
    }
    div.centre {width: 800px;margin : auto;text-align:center;}
    a.LesA { font-family : Verdana, Myranda,Arial, Helvetica, sans-serif;   font-size: 1.2em; color: #ffffff; text-decoration: none;}
    a.LesA:link { } 
    a.LesA:hover {color : #ff9999; }
    </style>
     
    </head>
    <body>
     
    <div class="centre" >
    <b>Suite de votre choix</b><br />
    <table><tr><td>
    <form method='post' action='selection3.php'><br />
    <?PHP
     
    if ($module=="xx") {echo "saisie incorecte"}
    else
      {
    $connexion = mysql_connect($host,$user,$pass);
    $connexion2 = mysql_select_db($dbase,$connexion);
    /* ================ module =================== */
       $result=mysql_query("select * from module
         WHERE  Index = '$module'");
       while ($row=mysql_fetch_array($result)) 
         {
          $Index1= stripslashes($row['Index']);
          $nommod= stripslashes($row['nommod']);
     
          echo "Pour le module  ".$Index1." ".$nommod."<br /> ";
          echo "Faites votre selection<br /> ";
          echo "<input name='modulex' type='hidden'  value=".$Index1."><br />";
          echo "<input name='moduley' type='hidden'  value=".$nommod."><br />";
     
         }
    /* ================ matiere =================== */
     
       echo "<SELECT name='matiere'>";
       $result=mysql_query("select * from matiere
         WHERE  idmod = '$Index1' ");
       while ($row=mysql_fetch_array($result)) 
         {
          $Index= stripslashes($row['Index']);
          $nommat= stripslashes($row['nommat']);
     
          echo  "<OPTION VALUE='".$Index."'>".$nommat."</OPTION>";
         }
         echo "</select><br />";
     
    /* ================ niveau =================== */
    $UnSeul="xxxx";
     
       echo "<SELECT name='niveau'>";
       $result=mysql_query("select * from etudiant
         WHERE  nometu >= ' ' and nometu <= 'zzzz'
         ORDER BY niveau ");
       while ($row=mysql_fetch_array($result)) 
         {
          $Index= stripslashes($row['Index']);
          $niveau= stripslashes($row['niveau']);
     
          $pos = strpos($UnSeul, $niveau);
    if ($pos === false) {$x=0;}
      else {
           $UnSeul=$UnSeul." ".$niveau." ";
           echo  "<OPTION VALUE='".$Index."'>".$niveau."</OPTION>";
           }
         }
         echo "</select><br />";
    /* ================ filiere =================== */
     
       echo "<SELECT name='filiere'>";
       $result=mysql_query("select * from filiere
         WHERE  Nomfili >= ' ' and Nomfili <= 'zzzz'
         ORDER BY Nomfili ");
     
       while ($row=mysql_fetch_array($result)) 
         {
          $Index= stripslashes($row['Index']);
          $Nomfili= stripslashes($row['Nomfili']);
     
          echo  "<OPTION VALUE='".$Index."'>".$Nomfili."</OPTION>";
         }
         echo "</select><br />";
     
       mysql_close();
       }
    ?>
     
    <br /><input type='submit' value='ok'>
    </form>
     
    </td></tr></table>
    <br />
    </div>
     
    </body></html>

    pos === false avec trois = c'est normal , cas des valeurs a 0

  7. #87
    Membre du Club Avatar de lilia_dream
    Inscrit en
    Mars 2009
    Messages
    267
    Détails du profil
    Informations forums :
    Inscription : Mars 2009
    Messages : 267
    Points : 43
    Points
    43
    Par défaut
    Merci FoxLeRenard

    mais chez moi les choses n'avance pas .

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
     
    <?PHP
    session_start();
    /* selection2.php */
    if (isset($_POST["module"])) $module=htmlentities(trim($_POST["module"]));
        else $module="xx";
    ?>
     
    <!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN'  'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
    <html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'>
    <head>
    <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
    <title>suivi scolaire</title>
    <meta name="keywords" content="suivi scolaire" />
    <meta name="description" content="suivi scolaire" />
    <meta name="robots" content="all" />
    <meta http-equiv="content-language" content="fr, en" />
    <meta name="expires" content="never" />
    <meta name="rating" content="general" />
    <meta name="revisit-after" content="30 days" />
    <style type="text/css">
    * {font-size : 100%;}
    html { width:100%;height : 100%;font-size : 100%;
    }
    BODY {
    width:100%;
    height : 100%;
    background-color : #557bac; 
    font-family : Verdana, Myranda,Arial, Helvetica, sans-serif; 
    font-size : 100%; 
    color : #ffffff; 
    margin-left : 0; 
    margin-right : 0;
    text-align:center;
    }
    div.centre {width: 800px;margin : auto;text-align:center;}
    a.LesA { font-family : Verdana, Myranda,Arial, Helvetica, sans-serif;   font-size: 1.2em; color: #ffffff; text-decoration: none;}
    a.LesA:link { } 
    a.LesA:hover {color : #ff9999; }
    </style>
     
    </head>
    <body>
     
    <div class="centre" >
    <b>Suite de votre choix</b><br />
    <table><tr><td>
    <form method='post' action='selection3.php'><br />
    <?PHP
     
    if ($module=="xx") 
    echo "saisie incorecte";
    else
      {
    // ------------------------------------------------------
    // connexion a la BD
    	include("_connexion.php");
    // ------------------------------------------------------
     
    /* ================ module =================== */
         $result=mysql_query("select * from module
         WHERE  Index = '$module'");
     
       while ($row=mysql_fetch_array($result)) 
         {
          $Index1= stripslashes($row['Index']);
          $nommod= stripslashes($row['nommod']);
     
          echo "Pour le module  ".$Index1." ".$nommod."<br /> ";
          echo "Faites votre selection<br /> ";
          echo "<input name='modulex' type='hidden'  value=".$Index1."><br />";
          echo "<input name='moduley' type='hidden'  value=".$nommod."><br />";
     
         }
    /* ================ matiere =================== */
     
       echo "<SELECT name='matiere'>";
       $result=mysql_query("select * from matiere
         WHERE  idmod = '$Index1' ");
       while ($row=mysql_fetch_array($result)) 
         {
          $Index= stripslashes($row['Index']);
          $nommat= stripslashes($row['nommat']);
     
          echo  "<OPTION VALUE='".$Index."'>".$nommat."</OPTION>";
         }
         echo "</select><br />";
     
    /* ================ niveau =================== */
    $UnSeul="xxxx";
     
       echo "<SELECT name='niveau'>";
       $result=mysql_query("select * from etudiant
         WHERE  nometu >= ' ' and nometu <= 'zzzz'
         ORDER BY niveau ");
       while ($row=mysql_fetch_array($result)) 
         {
          $Index= stripslashes($row['Index']);
          $niveau= stripslashes($row['niveau']);
     
          $pos = strpos($UnSeul, $niveau);
    if ($pos === false) {$x=0;}
      else {
           $UnSeul=$UnSeul." ".$niveau." ";
           echo  "<OPTION VALUE='".$Index."'>".$niveau."</OPTION>";
           }
         }
         echo "</select><br />";
    /* ================ filiere =================== */
     
       echo "<SELECT name='filiere'>";
       $result=mysql_query("select * from filiere
         WHERE  Nomfili >= ' ' and Nomfili <= 'zzzz'
         ORDER BY Nomfili ");
     
       while ($row=mysql_fetch_array($result)) 
         {
          $Index= stripslashes($row['Index']);
          $Nomfili= stripslashes($row['Nomfili']);
     
          echo  "<OPTION VALUE='".$Index."'>".$Nomfili."</OPTION>";
         }
         echo "</select><br />";
     
       mysql_close();
       }
    ?>
     
    <br /><input type='submit' value='ok'>
    </form>
     
    </td></tr></table>
    <br />
    </div>
     
    </body></html>
    Merci d'avance

  8. #88
    FoxLeRenard
    Invité(e)
    Par défaut
    Citation Envoyé par lilia_dream Voir le message
    Merci FoxLeRenard

    mais chez moi les choses n'avance pas .

    Merci d'avance
    Oui oui ça avance car on voit que les tables simples sont alimentées !!
    reste a mon sens un petit probléme avec les report d'index !

    Je vais regardé s'il est possible de dérouter ce probléme.

    Regardes le nouveau code que tu viens de tester, et dis moi, si tu trouves une faille ??

    A ce propos, dans connexion.php aurais tu par malchance des variables genre

    $module $Index etc...

    Bon si tu es là, je reviendrais dans la soirée.

    Ah si ... dernier point, tes nouvelles valeurs de tables que tu as écrites en majuscule, quand tu y va par PHPMYSQL tu les vois écrites ainsi, et les valeurs comprises sont bien correctes ?

  9. #89
    Membre du Club Avatar de lilia_dream
    Inscrit en
    Mars 2009
    Messages
    267
    Détails du profil
    Informations forums :
    Inscription : Mars 2009
    Messages : 267
    Points : 43
    Points
    43
    Par défaut Merci FoxLeRenard
    connexion.php

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
     
    <?php
    $host = 'localhost';
    $user = 'root';
    $pass = '';
    $dbase=" ";
    // Connexion au serveur
    $connexion = mysql_connect($host,$user,$pass)or die ("Erreur de connexion");
    mysql_select_db($dbase,$connexion)or die ("Erreur de connexion base");
    ?>
    Ah si ... dernier point, tes nouvelles valeurs de tables que tu as écrites en majuscule, quand tu y va par PHPMYSQL tu les vois écrites ainsi, et les valeurs comprises sont bien correctes ?
    Si si

  10. #90
    FoxLeRenard
    Invité(e)
    Par défaut
    Ton MYSQL
    Je penses a ça, comme tu as changé ta structure de base de donnée Mysql,
    tupeux donc comme tu l'avais fait, me faire un export total de tes tables ET CONTENUS
    parceque moi je pourrais l'injecter a la place des miennes sur mon site ,et teste mon code, il me faudrait pas longtemps pour trouver le détailqui nos bloque !!
    Merci d'avance

  11. #91
    Membre du Club Avatar de lilia_dream
    Inscrit en
    Mars 2009
    Messages
    267
    Détails du profil
    Informations forums :
    Inscription : Mars 2009
    Messages : 267
    Points : 43
    Points
    43
    Par défaut
    vous trouverez ci-joint le fichier sql de ma BDD

    Merci d'avance

  12. #92
    FoxLeRenard
    Invité(e)
    Par défaut
    Citation Envoyé par lilia_dream Voir le message
    vous trouverez ci-joint le fichier sql de ma BDD

    Merci d'avance
    Super donc a cette nuit
    Ou demain

  13. #93
    Membre du Club Avatar de lilia_dream
    Inscrit en
    Mars 2009
    Messages
    267
    Détails du profil
    Informations forums :
    Inscription : Mars 2009
    Messages : 267
    Points : 43
    Points
    43
    Par défaut
    Merci FoxLeRenard

    merci de prêter attention à mon problème, merci aussi de votre temps

    Merci beaucoup

  14. #94
    FoxLeRenard
    Invité(e)
    Par défaut
    Citation Envoyé par lilia_dream Voir le message
    Merci FoxLeRenard
    Bon il y avait des détails partout
    Il va falloir que tu regeneres tes tables en effet les index n'étaient pas tous smallint plus quelques details sur les noms des index

    Les deux PHP revus complétement
    gestion.sql

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
     
    -- phpMyAdmin SQL Dump
    -- version 2.6.1
    -- http://www.phpmyadmin.net
    -- 
    -- Serveur: localhost
    -- Généré le : Jeudi 18 Juin 2009 a 17:12
    -- Version du serveur: 4.1.9
    -- Version de PHP: 4.3.10
    -- 
    -- Base de données: `gestion`
    -- 
     
    -- --------------------------------------------------------
     
    -- 
    -- Structure de la table `enseignant`
    -- 
    DROP TABLE IF EXISTS `enseignant`;
    CREATE TABLE `enseignant` (
      `IndexE` smallint(5) unsigned NOT NULL auto_increment,
      `nomens` varchar(50) NOT NULL default '',
      `prenomens` varchar(50) NOT NULL default '',
      `adresseens` varchar(255) NOT NULL default '',
      `email` varchar(50) NOT NULL default '',
      `tel` varchar(50) NOT NULL default '',
      PRIMARY KEY  (`IndexE`),
      UNIQUE KEY `nomens` (`nomens`)
    ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=4 ;
     
    -- 
    -- Contenu de la table `enseignant`
    -- 
     
    INSERT INTO `enseignant` VALUES (1, 'Jack', 'Joe', ' ', ' ', ' ');
    INSERT INTO `enseignant` VALUES (2, 'Manon', 'lili', ' ', ' ', ' ');
    INSERT INTO `enseignant` VALUES (3, 'Nil', 'cedrick', ' ', ' ', ' ');
     
    -- --------------------------------------------------------
     
    -- 
    -- Structure de la table `etudiant`
    -- 
    DROP TABLE IF EXISTS `etudiant`;
    CREATE TABLE `etudiant` (
      `IndexX` smallint(5) unsigned NOT NULL auto_increment,
      `codetu` varchar(11) NOT NULL default '',
      `nometu` varchar(50) NOT NULL default '',
      `prenom` varchar(50) NOT NULL default '',
      `adresse` varchar(255) NOT NULL default '',
      `email` varchar(50) NOT NULL default '',
      `tele` varchar(50) NOT NULL default '',
      `niveau` varchar(50) NOT NULL default '',
      PRIMARY KEY  (`IndexX`),
      UNIQUE KEY `codetu` (`codetu`)
    ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=5 ;
     
    -- 
    -- Contenu de la table `etudiant`
    -- 
     
    INSERT INTO `etudiant` VALUES (1, 'lili', 'may', 'elle', 'N543', 'test1@test.com', '00000000', 'classe1');
    INSERT INTO `etudiant` VALUES (2, 'may', 'lili', 'elle', 'N321', 'test2@test.com', '0000000000', 'classe2');
    INSERT INTO `etudiant` VALUES (3, 'etu1', 'eleve1', 'il', 'N102', 'test@test.com', '0000000000', 'classe1');
    INSERT INTO `etudiant` VALUES (4, 'etu2', 'eleve2', 'elle', 'N 330', 'test1@test.com', '00000000', 'classe2');
     
    -- --------------------------------------------------------
     
    -- 
    -- Structure de la table `filiere`
    -- 
     
    DROP TABLE IF EXISTS `filiere`;
    CREATE TABLE `filiere` (
      `IndexF` smallint(5) unsigned NOT NULL auto_increment,
      `Nomfili` varchar(11) NOT NULL default '',
      `Index_eleve` smallint(5) unsigned  NOT NULL default '',
      PRIMARY KEY  (`IndexF`),
      UNIQUE KEY `Nomfili` (`Nomfili`)
    ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;
     
    -- 
    -- Contenu de la table `filiere`
    -- 
     
    INSERT INTO `filiere` VALUES (1, 'TGI', 1);
    INSERT INTO `filiere` VALUES (2, 'TSGI', 2);
     
    -- --------------------------------------------------------
     
    -- 
    -- Structure de la table `matiere`
    -- 
    DROP TABLE IF EXISTS `matiere`;
    CREATE TABLE `matiere` (
      `IndexM` smallint(5) unsigned NOT NULL auto_increment,
      `nommat` varchar(50) NOT NULL default '',
      `idmod`  smallint(5) unsigned  NOT NULL default '0',
      `coefmat` int(11) NOT NULL default '0',
      `Index_enseignant` smallint(5) unsigned NOT NULL default '0',
      PRIMARY KEY  (`IndexM`),
      UNIQUE KEY `nommat` (`nommat`)
    ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;
     
    -- 
    -- Contenu de la table `matiere`
    -- 
     
    INSERT INTO `matiere` VALUES (1, 'Francais', 1, 2, 0);
    INSERT INTO `matiere` VALUES (2, 'Englais', 2, 3, 0);
     
    -- --------------------------------------------------------
     
    -- 
    -- Structure de la table `module`
    -- 
    DROP TABLE IF EXISTS `module`;
    CREATE TABLE `module` (
      `IndexM2` smallint(5) unsigned NOT NULL auto_increment,
      `nommod` varchar(50) NOT NULL default '',
      PRIMARY KEY  (`IndexM2`)
    ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;
     
    -- 
    -- Contenu de la table `module`
    -- 
     
    INSERT INTO `module` VALUES (1, 'Formation-Humaine');
    INSERT INTO `module` VALUES (2, 'Mathématiques');
     
    -- --------------------------------------------------------
     
    -- 
    -- Structure de la table `note`
    -- 
    DROP TABLE IF EXISTS `note`;
    CREATE TABLE `note` (
      `IndexN` smallint(5) unsigned NOT NULL auto_increment,
      `Index_eleve` smallint(5) unsigned  NOT NULL default '0',
      `Index_matiere` smallint(5) unsigned  NOT NULL default '0',
      `note` int(11) NOT NULL default '0',
      `datenote` date NOT NULL default '0000-00-00',
      PRIMARY KEY  (`IndexN`),
      UNIQUE KEY `datenote` (`datenote`)
    ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;
     
    -- 
    -- Contenu de la table `note`
    -- 
     
    INSERT INTO `note` VALUES (1,1,1,15,'2009-11-04' );
    INSERT INTO `note` VALUES (2,2,2,4,'2009-10-10' );
    selection1.php
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
     
    <?PHP
    session_start();
    /* selection1.php */
    ?>
     
    <!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN'  'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
    <html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'>
    <head>
    <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
    <title>suivi scolaire</title>
    <meta name="keywords" content="suivi scolaire" />
    <meta name="description" content="suivi scolaire" />
    <meta name="robots" content="all" />
    <meta http-equiv="content-language" content="fr, en" />
    <meta name="expires" content="never" />
    <meta name="rating" content="general" />
    <meta name="revisit-after" content="30 days" />
    <style type="text/css">
    * {font-size : 100%;}
    html { width:100%;height : 100%;font-size : 100%;
    }
    BODY {
    width:100%;
    height : 100%;
    background-color : #557bac; 
    font-family : Verdana, Myranda,Arial, Helvetica, sans-serif; 
    font-size : 100%; 
    color : #ffffff; 
    margin-left : 0; 
    margin-right : 0;
    text-align:center;
    }
    div.centre {width: 800px;margin : auto;text-align:center;}
    a.LesA { font-family : Verdana, Myranda,Arial, Helvetica, sans-serif;   font-size: 1.2em; color: #ffffff; text-decoration: none;}
    a.LesA:link { } 
    a.LesA:hover {color : #ff9999; }
    </style>
     
    </head>
    <body>
     
    <div class="centre" >
    <b>Choisissez votre Module</b><br />
    <table><tr><td>
    <form method='post' action='selection2.php'><br />
    <?PHP
    $Serveur = "localhost";
     $User = "root";
     $Mdp =  "";
     $MaBase = "mysql";
     
    $connexion = mysql_connect($Serveur,$User,$Mdp);
    $connexion2 = mysql_select_db($MaBase);
     
       $result=mysql_query("select * from `module`
         WHERE  `nommod` >= ' ' and `nommod` <= 'zzzz'
         ORDER BY `nommod` ");
       while ($row=mysql_fetch_array($result)) 
         {
          $IndexM2= stripslashes($row['IndexM2']);
          $nommod= stripslashes($row['nommod']);
     
          echo "<input type='radio' name='modulex'  value=".$IndexM2.">";
          echo " code ".$IndexM2." ".$nommod."<br /> ";
         }
       mysql_close();
    ?>
     
    <br /><input type='submit' value='ok'>
    </form>
    </td></tr></table>
    <br />
    </div>
    </body></html>
    selection2.php

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
     
    <?PHP
    session_start();
    /* selection2.php */
    if (isset($_POST['modulex'])) $modulex=trim($_POST['modulex']);
        else $modulex=0;
    ?>
     
    <!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN'  'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
    <html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'>
    <head>
    <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
    <title>suivi scolaire</title>
    <meta name="keywords" content="suivi scolaire" />
    <meta name="description" content="suivi scolaire" />
    <meta name="robots" content="all" />
    <meta http-equiv="content-language" content="fr, en" />
    <meta name="expires" content="never" />
    <meta name="rating" content="general" />
    <meta name="revisit-after" content="30 days" />
    <style type="text/css">
    * {font-size : 100%;}
    html { width:100%;height : 100%;font-size : 100%;
    }
    BODY {
    width:100%;
    height : 100%;
    background-color : #557bac; 
    font-family : Verdana, Myranda,Arial, Helvetica, sans-serif; 
    font-size : 100%; 
    color : #ffffff; 
    margin-left : 0; 
    margin-right : 0;
    text-align:center;
    }
    div.centre {width: 800px;margin : auto;text-align:center;}
    a.LesA { font-family : Verdana, Myranda,Arial, Helvetica, sans-serif;   font-size: 1.2em; color: #ffffff; text-decoration: none;}
    a.LesA:link { } 
    a.LesA:hover {color : #ff9999; }
    </style>
     
    </head>
    <body>
     
    <div class="centre" >
    <b>Suite de votre choix</b><br />
    <table><tr><td>
    <form method='post' action='selection3.php'><br />
    <?PHP
     
    if ($modulex==0) {echo "saisie incorecte";}
    else
      {
     $Serveur = "localhost";
     $User = "root";
     $Mdp =  "";
     $MaBase = "mysql";
    $connexion = mysql_connect($Serveur,$User,$Mdp);
    $connexion2 = mysql_select_db($MaBase);
     
    /* ================ module =================== */
       $resulta=mysql_query("select * from `module`
         WHERE  `IndexM2` = '$modulex'");
     
     
       while ($row=mysql_fetch_array($resulta)) 
         { 
          $IndexM2= stripslashes($row['IndexM2']);
          $nommod= stripslashes($row['nommod']);
     
          echo "Pour le module  ".$IndexM2." ".$nommod."<br /> ";
          echo "Faites votre selection<br /> ";
          echo "<input name='modulex' type='hidden'  value=".$IndexM2."><br />";
          echo "<input name='moduley' type='hidden'  value=".$nommod."><br />";
     
         } 
    /* ================ matiere =================== */
     
       echo "<SELECT name='matiere'>";
       $result=mysql_query("select * from matiere
         WHERE  `idmod` = '$IndexM2' ");
       while ($row=mysql_fetch_array($result)) 
         {
          $IndexM= stripslashes($row['IndexM']);
          $nommat= stripslashes($row['nommat']);
     
          echo  "<OPTION VALUE='".$IndexM."'>".$nommat."</OPTION>";
         }
         echo "</select><br />";
     
    /* ================ niveau =================== */
       $UnSeul="xxxxxxxxxx";
     
       echo "<SELECT name='niveau'>";
       $result=mysql_query("select * from etudiant
         WHERE  nometu >= ' ' and nometu <= 'zzzz'
         ORDER BY nometu ");
       while ($row=mysql_fetch_array($result)) 
         {
          $IndexX= stripslashes($row['IndexX']);
          $niveau= stripslashes($row['niveau']);
          $pos =strpos($UnSeul,$niveau, 1);
          if ($pos <4)
            {
             $UnSeul=$UnSeul." ".$niveau." ";
             echo  "<OPTION VALUE='".$IndexX."'>".$niveau."</OPTION>";
            }
         }
         echo "</select><br />";
    /* ================ filiere =================== */
     
       echo "<SELECT name='filiere'>";
       $result=mysql_query("select * from filiere
         WHERE  Nomfili >= ' ' and Nomfili <= 'zzzz'
         ORDER BY Nomfili ");
     
       while ($row=mysql_fetch_array($result)) 
         {
          $IndexF= stripslashes($row['IndexF']);
          $Nomfili= stripslashes($row['Nomfili']);
     
          echo  "<OPTION VALUE='".$IndexF."'>".$Nomfili."</OPTION>";
         }
         echo "</select><br />";
     
       mysql_close();
       }
    ?>
     
    <br /><input type='submit' value='ok'>
    </form>
     
    </td></tr></table>
    <br />
    </div>
     
    </body></html>
    Chez moi ça marche impec !

  15. #95
    Membre du Club Avatar de lilia_dream
    Inscrit en
    Mars 2009
    Messages
    267
    Détails du profil
    Informations forums :
    Inscription : Mars 2009
    Messages : 267
    Points : 43
    Points
    43
    Par défaut
    Merci FoxLeRenard

    les scripts marchent impeccablement

    aucune erreur

    Merci d'avance

  16. #96
    Membre du Club Avatar de lilia_dream
    Inscrit en
    Mars 2009
    Messages
    267
    Détails du profil
    Informations forums :
    Inscription : Mars 2009
    Messages : 267
    Points : 43
    Points
    43
    Par défaut
    Je te remercie beaucoup pour votre réponse très détaillée.

    j'ai une question ,sur l'affichage des données récupérer dans les listes déroulantes

    est-t-il possible de mettre un tableau HTML qui rassemble les données des listes deroulantes?

    exemple
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
     
    ===================================================================
    Nom_eleve====Matiere-a note====filiere===zone-de-saisir--la note=======
    ====================================================================
    +++lilia++++++++++Englais++++++++TGI+++++++++++12++++++++++++++
    +++Manon++++++++Englais++++++TGI++++++++++++12++++++++++++++
    +++salma+++++++++Englais++++++++TGI++++++++++12++++++++++++++
    etc......
    ==========================================================
    Un tableau dynamique selon les choix des listes deroulantes

    Merci pour ton aide précieuse FoxLeRenard

  17. #97
    Membre du Club Avatar de lilia_dream
    Inscrit en
    Mars 2009
    Messages
    267
    Détails du profil
    Informations forums :
    Inscription : Mars 2009
    Messages : 267
    Points : 43
    Points
    43
    Par défaut
    Bonjour à tous

    Bonjour FoxLeRenard

    tout d'abord je suis désolée d'avoir remonter ce ancien message

    j'aimerai juste si c'est possible FoxLeRenard de continuer votre travail avec moi

    pour présenter les choix des listes déroulantes dans un tableau dynamique HTML

    Merci d'avance

  18. #98
    FoxLeRenard
    Invité(e)
    Par défaut
    Citation Envoyé par lilia_dream Voir le message
    Bonjour à tous
    j'aimerai juste si c'est possible continuer pour présenter les choix des listes déroulantes dans un tableau dynamique HTML
    Merci d'avance
    Ok mais pas avant ce soir pour moi, mais si un bon codeur PHP passe dans le coin , ce serait parfait

    Whaou bravo l'Avatar

  19. #99
    Membre du Club Avatar de lilia_dream
    Inscrit en
    Mars 2009
    Messages
    267
    Détails du profil
    Informations forums :
    Inscription : Mars 2009
    Messages : 267
    Points : 43
    Points
    43
    Par défaut Merci de nouveau
    Merci FoxLeRenard

    Merci aussi pour le lien

    Merci d'avance

  20. #100
    FoxLeRenard
    Invité(e)
    Par défaut
    Citation Envoyé par lilia_dream Voir le message
    Merci FoxLeRenard
    Bon alors j'ais du ajuster les tables car des cles uniques declarées étaient impossible.
    D'autre part il me fallait inventer des nom et des notes pour tester ...

    donc le nouveau SQL est
    gestion.sql
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
     
     
    -- phpMyAdmin SQL Dump
    -- version 2.6.1
    -- http://www.phpmyadmin.net
    -- 
    -- Serveur: localhost
    -- Généré le : Jeudi 18 Juin 2009 a 17:12
    -- Version du serveur: 4.1.9
    -- Version de PHP: 4.3.10
    -- 
    -- Base de données: `gestion`
    -- 
     
    -- --------------------------------------------------------
     
    -- 
    -- Structure de la table `enseignant`
    -- 
    DROP TABLE IF EXISTS `enseignant`;
    CREATE TABLE `enseignant` (
      `IndexE` smallint(5) unsigned NOT NULL auto_increment,
      `nomens` varchar(50) NOT NULL default '',
      `prenomens` varchar(50) NOT NULL default '',
      `adresseens` varchar(255) NOT NULL default '',
      `email` varchar(50) NOT NULL default '',
      `tel` varchar(50) NOT NULL default '',
      PRIMARY KEY  (`IndexE`),
      UNIQUE KEY `nomens` (`nomens`)
    ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=4 ;
     
    -- 
    -- Contenu de la table `enseignant`
    -- 
     
    INSERT INTO `enseignant` VALUES (1, 'Jack', 'Joe', ' ', ' ', ' ');
    INSERT INTO `enseignant` VALUES (2, 'Manon', 'lili', ' ', ' ', ' ');
    INSERT INTO `enseignant` VALUES (3, 'Nil', 'cedrick', ' ', ' ', ' ');
     
    -- --------------------------------------------------------
     
    -- 
    -- Structure de la table `etudiant`
    -- 
    DROP TABLE IF EXISTS `etudiant`;
    CREATE TABLE `etudiant` (
      `IndexX` smallint(5) unsigned NOT NULL auto_increment,
      `codetu` varchar(11) NOT NULL default '',
      `nometu` varchar(50) NOT NULL default '',
      `prenom` varchar(50) NOT NULL default '',
      `adresse` varchar(255) NOT NULL default '',
      `email` varchar(50) NOT NULL default '',
      `tele` varchar(50) NOT NULL default '',
      `niveau` varchar(50) NOT NULL default '',
      PRIMARY KEY  (`IndexX`)
    ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=5 ;
     
    -- 
    -- Contenu de la table `etudiant`
    -- 
     
    INSERT INTO `etudiant` VALUES (1, 'lili', 'may', 'elle', 'N543', 'test1@test.com', '00000000', 'classe1');
    INSERT INTO `etudiant` VALUES (2, 'may', 'lili', 'elle', 'N321', 'test2@test.com', '0000000000', 'classe2');
    INSERT INTO `etudiant` VALUES (3, 'etu1', 'eleve1', 'il', 'N102', 'test@test.com', '0000000000', 'classe1');
    INSERT INTO `etudiant` VALUES (4, 'etu2', 'eleve2', 'elle', 'N 330', 'test1@test.com', '00000000', 'classe2');
     
    -- --------------------------------------------------------
     
    -- 
    -- Structure de la table `filiere`
    -- 
     
    DROP TABLE IF EXISTS `filiere`;
    CREATE TABLE `filiere` (
      `IndexF` smallint(5) unsigned NOT NULL auto_increment,
      `Nomfili` varchar(11) NOT NULL default '',
      `Index_eleve` smallint(5) unsigned  NOT NULL default '',
      PRIMARY KEY  (`IndexF`)
    ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=9 ;
     
    -- 
    -- Contenu de la table `filiere`
    -- 
     
    INSERT INTO `filiere` VALUES (1, 'TGI',  1);
    INSERT INTO `filiere` VALUES (2, 'TSGI', 1);
    INSERT INTO `filiere` VALUES (3, 'TSGI', 2);
    INSERT INTO `filiere` VALUES (4, 'TSGI', 3);
    INSERT INTO `filiere` VALUES (5, 'TGI', 2);
    INSERT INTO `filiere` VALUES (6, 'TGI', 3);
    INSERT INTO `filiere` VALUES (7, 'TGI', 4);
    INSERT INTO `filiere` VALUES (8, 'TSGI', 4);
     
     
    -- --------------------------------------------------------
     
    -- 
    -- Structure de la table `matiere`
    -- 
    DROP TABLE IF EXISTS `matiere`;
    CREATE TABLE `matiere` (
      `IndexM` smallint(5) unsigned NOT NULL auto_increment,
      `nommat` varchar(50) NOT NULL default '',
      `idmod`  smallint(5) unsigned  NOT NULL default '0',
      `coefmat` int(11) NOT NULL default '0',
      `Index_enseignant` smallint(5) unsigned NOT NULL default '0',
      PRIMARY KEY  (`IndexM`),
      UNIQUE KEY `nommat` (`nommat`)
    ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;
     
    -- 
    -- Contenu de la table `matiere`
    -- 
     
    INSERT INTO `matiere` VALUES (1, 'Francais', 1, 2, 0);
    INSERT INTO `matiere` VALUES (2, 'Anglais', 2, 3, 0);
     
    -- --------------------------------------------------------
     
    -- 
    -- Structure de la table `module`
    -- 
    DROP TABLE IF EXISTS `module`;
    CREATE TABLE `module` (
      `IndexM2` smallint(5) unsigned NOT NULL auto_increment,
      `nommod` varchar(50) NOT NULL default '',
      PRIMARY KEY  (`IndexM2`)
    ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;
     
    -- 
    -- Contenu de la table `module`
    -- 
     
    INSERT INTO `module` VALUES (1, 'Formation-Humaine');
    INSERT INTO `module` VALUES (2, 'Mathématiques');
     
    -- --------------------------------------------------------
     
    -- 
    -- Structure de la table `note`
    -- 
    DROP TABLE IF EXISTS `note`;
    CREATE TABLE `note` (
      `IndexN` smallint(5) unsigned NOT NULL auto_increment,
      `Index_eleve` smallint(5) unsigned  NOT NULL default '0',
      `Index_matiere` smallint(5) unsigned  NOT NULL default '0',
      `note` int(11) NOT NULL default '0',
      `datenote` date NOT NULL default '0000-00-00',
      PRIMARY KEY  (`IndexN`)
    ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=16 ;
     
    -- 
    -- Contenu de la table `note`
    -- 
     
    INSERT INTO `note` VALUES (1,1,1,15,'2009-11-04' );
    INSERT INTO `note` VALUES (2,2,1,14,'2009-10-10' );
    INSERT INTO `note` VALUES (3,3,1,10,'2009-10-10' );
    INSERT INTO `note` VALUES (4,4,1,9,'2009-10-10' );
    INSERT INTO `note` VALUES (5,1,2,11,'2009-10-10' );
    INSERT INTO `note` VALUES (6,2,2,12,'2009-10-10' );
    INSERT INTO `note` VALUES (7,3,2,14,'2009-10-10' );
    INSERT INTO `note` VALUES (8,4,2,11,'2009-10-10' );
    INSERT INTO `note` VALUES (9,1,3,1,'2009-10-10' );
    INSERT INTO `note` VALUES (10,2,3,0,'2009-10-10' );
    INSERT INTO `note` VALUES (11,3,3,14,'2009-10-10' );
    INSERT INTO `note` VALUES (12,4,3,11,'2009-10-10' );
    INSERT INTO `note` VALUES (13,1,4,1,'2009-10-10' );
    INSERT INTO `note` VALUES (14,2,4,11,'2009-10-10' );
    INSERT INTO `note` VALUES (15,3,4,14,'2009-10-10' );
    Je n'ais pas modifié selection1.php


    par contre bien sur selection2.php est changé

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
     
     
    <?PHP
    session_start();
    /* selection2.php */
    if (isset($_POST['modulex'])) $modulex=trim($_POST['modulex']);
        else $modulex=0;
    ?>
     
    <!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN'  'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
    <html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'>
    <head>
    <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
    <title>suivi scolaire</title>
    <meta name="keywords" content="suivi scolaire" />
    <meta name="description" content="suivi scolaire" />
    <meta name="robots" content="all" />
    <meta http-equiv="content-language" content="fr, en" />
    <meta name="expires" content="never" />
    <meta name="rating" content="general" />
    <meta name="revisit-after" content="30 days" />
    <style type="text/css">
    * {font-size : 100%;}
    html { width:100%;height : 100%;font-size : 100%;
    }
    BODY {
    width:100%;
    height : 100%;
    background-color : #557bac; 
    font-family : Verdana, Myranda,Arial, Helvetica, sans-serif; 
    font-size : 100%; 
    color : #ffffff; 
    margin-left : 0; 
    margin-right : 0;
    text-align:center;
    }
    div.centre {width: 800px;margin : auto;text-align:center;}
    a.LesA { font-family : Verdana, Myranda,Arial, Helvetica, sans-serif;   font-size: 1.2em; color: #ffffff; text-decoration: none;}
    a.LesA:link { } 
    a.LesA:hover {color : #ff9999; }
    </style>
     
    </head>
    <body>
     
    <div class="centre" >
    <b>Suite de votre choix</b><br />
    <table><tr><td>
    <form method='post' action='selection3.php'><br />
    <?PHP
     
    if ($modulex==0) {echo "saisie incorecte";}
    else
      {
     $Serveur = "localhost";
     $User = "root";
     $Mdp =  "";
     $MaBase = "mysql";
    $connexion = mysql_connect($Serveur,$User,$Mdp);
    $connexion2 = mysql_select_db($MaBase);
     
    /* ================ module =================== */
       $resulta=mysql_query("select * from `module`
         WHERE  `IndexM2` = '$modulex'");
     
     
       while ($row=mysql_fetch_array($resulta)) 
         { 
          $IndexM2= stripslashes($row['IndexM2']);
          $nommod= stripslashes($row['nommod']);
     
          echo "Pour le module  ".$IndexM2." ".$nommod."<br /> ";
          echo "Faites votre selection<br /> ";
          echo "<input name='modulex' type='hidden'  value=".$IndexM2."><br />";
          echo "<input name='moduley' type='hidden'  value=".$nommod."><br />";
     
         } 
    /* ================ matiere =================== */
     
       echo "<SELECT name='matiere'>";
       $result=mysql_query("select * from matiere
         WHERE  `idmod` = '$IndexM2' ");
       while ($row=mysql_fetch_array($result)) 
         {
          $IndexM= stripslashes($row['IndexM']);
          $nommat= stripslashes($row['nommat']);
     
          echo  "<OPTION VALUE='".$IndexM."'>".$nommat."</OPTION>";
         }
         echo "</select><br />";
     
    /* ================ niveau =================== */
       $UnSeul="xxxxxxxxxx";
     
       echo "<SELECT name='niveau'>";
       $result=mysql_query("select * from etudiant
         WHERE  nometu >= ' ' and nometu <= 'zzzz'
         ORDER BY nometu ");
       while ($row=mysql_fetch_array($result)) 
         {
          $IndexX= stripslashes($row['IndexX']);
          $niveau= stripslashes($row['niveau']);
          $pos =strpos($UnSeul,$niveau, 1);
          if ($pos <4)
            {
             $UnSeul=$UnSeul." ".$niveau." ";
             echo  "<OPTION VALUE='".$niveau."'>".$niveau."</OPTION>";
            }
         }
         echo "</select><br />";
    /* ================ filiere =================== */
     
       echo "<SELECT name='filiere'>";
       $result=mysql_query("select * from filiere
         WHERE  Nomfili >= ' ' and Nomfili <= 'zzzz'
         ORDER BY Nomfili ");
         $UnSeul="xxxxxxxxxx";
       while ($row=mysql_fetch_array($result)) 
         {
          $IndexF= stripslashes($row['IndexF']);
          $Nomfili= stripslashes($row['Nomfili']);
          $pos =strpos($UnSeul,$Nomfili, 1);
          if ($pos <4)
            {
            $UnSeul=$UnSeul." ".$Nomfili." ";
             echo  "<OPTION VALUE='".$IndexF."'>".$Nomfili."</OPTION>";
            }
         }
         echo "</select><br />";
     
       mysql_close();
       }
    ?>
     
    <br /><input type='submit' value='ok'>
    </form>
     
    </td></tr></table>
    <br />
    </div>
     
    </body></html>
    enfin j'ais imaginé selection3.php pour le genre de tableau que tu veux !

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
     
    <?PHP
    session_start();
    /* selection3.php */
    if (isset($_POST['modulex'])) $modulex=trim($_POST['modulex']);
        else $modulex=0;
    if (isset($_POST['moduley'])) $modulNom=trim($_POST['moduley']);
        else $modulNom="";
    if (isset($_POST['matiere'])) $matiere=trim($_POST['matiere']);
        else $matiere=0;        /* $IndexM */
    if (isset($_POST['niveau'])) $niveauX=trim($_POST['niveau']);
        else $niveauX="";         /* $IndexX */
    if (isset($_POST['filiere'])) $filiere=trim($_POST['filiere']);
        else $filiere=0;         /* $IndexF */
     
     $Serveur = "localhost";
     $User = "root";
     $Mdp =  "";
     $MaBase = "mysql";
    $connexion = mysql_connect($Serveur,$User,$Mdp);
    $connexion2 = mysql_select_db($MaBase);
     
     
    ?>
     
    <!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN'  'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
    <html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'>
    <head>
    <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
    <title>suivi scolaire</title>
    <meta name="keywords" content="suivi scolaire" />
    <meta name="description" content="suivi scolaire" />
    <meta name="robots" content="all" />
    <meta http-equiv="content-language" content="fr, en" />
    <meta name="expires" content="never" />
    <meta name="rating" content="general" />
    <meta name="revisit-after" content="30 days" />
    <style type="text/css">
    * {font-size : 100%;}
    html { width:100%;height : 100%;font-size : 100%;
    }
    BODY {
    width:100%;
    height : 100%;
    background-color : #557bac; 
    font-family : Verdana, Myranda,Arial, Helvetica, sans-serif; 
    font-size : 100%; 
    color : #ffffff; 
    margin-left : 0; 
    margin-right : 0;
    text-align:center;
    }
    div.centre {width: 800px;margin : auto;text-align:center;}
    a.LesA { font-family : Verdana, Myranda,Arial, Helvetica, sans-serif;   font-size: 1.2em; color: #ffffff; text-decoration: none;}
    a.LesA:link { } 
    a.LesA:hover {color : #ff9999; }
    </style>
     
    </head>
    <body>
     
    <div class="centre" >
     
    <table border=2 >
    <tr><td> Nom_eleve </td><td> Matiere  </td><td>  module </td><td> filiere  </td><td> zone-de-saisir la note </td></tr> 
    <?PHP
    /* ================ matiere =================== */
     
       $result=mysql_query("select * from matiere
         WHERE  `IndexM` = '$matiere' ");
       while ($row=mysql_fetch_array($result)) 
         {
          $IndexM= stripslashes($row['IndexM']);
          $nommat= stripslashes($row['nommat']);
         }
     
    /* ================ filiere =================== */
       $result=mysql_query("select * from filiere
         WHERE  `IndexF` = '$filiere' ");
       while ($row=mysql_fetch_array($result)) 
         {
          $IndexF= stripslashes($row['IndexF']);
          $Nomfili= stripslashes($row['Nomfili']);
         }
     
    /* ===On rempli le tableau eleves notes================ */
       $result=mysql_query("select * from note
         WHERE  `Index_matiere` = '$matiere' ");
       while ($row=mysql_fetch_array($result)) 
         {
          $Index_eleve= stripslashes($row['Index_eleve']);
          $note= stripslashes($row['note']);
          $datenote= stripslashes($row['datenote']);
          $result2=mysql_query("select * from etudiant
             WHERE  `IndexX` = '$Index_eleve' ");
             while ($row2=mysql_fetch_array($result2)) 
              {
                 $nometu= stripslashes($row2['nometu']);
                 $niveau= stripslashes($row2['niveau']);
    if($niveauX==$niveau )
    echo ("<tr><td> ".$nometu." </td><td> ".$nommat."  </td><td>  ".$modulNom." </td><td> ".$Nomfili." ".$niveau."  </td><td> ".$note."     ".$datenote." </td></tr>");
     
              }
         }
       mysql_close();
    ?>
     
    </table><br />
    </body></html>

Discussions similaires

  1. Requête syntaxe de calcul par comparaison
    Par valalu dans le forum Requêtes et SQL.
    Réponses: 2
    Dernier message: 04/07/2007, 12h41
  2. Réponses: 3
    Dernier message: 24/03/2007, 14h42
  3. Saisie de calcul par l'utilisateur
    Par zenaf dans le forum C
    Réponses: 11
    Dernier message: 26/10/2006, 20h42
  4. Pb Requetes et calcul par condition
    Par flagfight dans le forum Access
    Réponses: 2
    Dernier message: 19/05/2006, 11h30
  5. [Access] Calcule par ligne dans une requête
    Par Belze dans le forum Langage SQL
    Réponses: 2
    Dernier message: 13/02/2006, 10h09

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo