Advertisement
Guest User

Untitled

a guest
Sep 25th, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.94 KB | None | 0 0
  1.     <?php
  2.  
  3.         /* A principio essa primeira parte dele, esta trazendo o ANO correto, só que o CodSerie, ele traz um anterior ou mesmo, eu creio que ele não está conseguindo pegar o CodSerie pra poder verificar na tabela de serie o CodTurma...
  4.        
  5.         $descricao_turma = $_GET['descricoes'];
  6.         $serie = $_GET['series'];
  7.  
  8.         require "conexao.php";
  9.  
  10.        $result = mysql_query("select * from turma where codturma= $descricao_turma");
  11.  
  12.        while($row = mysql_fetch_array($result) ){
  13.             echo "<option value='".$row['CODTURMA']."'>".$row['DESCRICAO']."</option>";
  14.  
  15.        }
  16.        
  17.        $result = mysql_query("SELECT serie.*, turma.*
  18.                                 from turma
  19.                                 join serie on serie.codserie = turma.codserie
  20.                               where turma.codserie=$serie " );
  21.  
  22.        while($row = mysql_fetch_array($result) ){
  23.             echo "<option value='".$row['CODSERIE']."'>".$row['DESCRICAO_SERIE']."</option>";
  24.  
  25.        }*/
  26.        
  27.      
  28.      //Aqui esta a parte implementada como estamos a discutir no fórum....
  29.      require "conexao.php";
  30.        
  31.     if(isset($_GET['descricao_turma']))
  32.        
  33.     {
  34.  
  35.         $descricao_turma = $_GET['descricoes'];
  36.         $result = mysql_query("select * from turma where codturma= $descricao_turma");
  37.  
  38.        while($row = mysql_fetch_array($result) )
  39.        {
  40.             echo "<option value='".$row['CODTURMA']."'>".$row['DESCRICAO']."</option>";
  41.  
  42.        }
  43.  
  44.     }
  45.  
  46.     if(isset($_GET['series']))
  47.     {
  48.            $serie = $_GET['series'];  
  49.            $result = mysql_query("SELECT serie.*, turma.*
  50.                               from turma
  51.                               join serie on serie.codserie = turma.codserie
  52.                             where turma.codserie=$serie " );
  53.       while($row = mysql_fetch_array($result) )
  54.       {
  55.             echo "<option value='".$row['CODSERIE']."'>".$row['DESCRICAO_SERIE']."</option>";
  56.  
  57.       }
  58.      
  59.     }
  60.  
  61. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement