Jump to content

Listagem de utilizadores


man008

Recommended Posts

Bom dia todo o dia;

Olá pessoal estou a desenvolver o meu projecto da pap estou com um pequeno problema:

Queria listar todos os utilizadores, menos o administrador mas não estou a conseguir , basicamente queria mostrar as linhas onde o numero_informático é >0

numero_informático é a minha chave primaria

agradecia desde desde já a vossa ajuda 🙂

tenho aqui a função:

public function n_informatico($numero_informatico)

{      
       $result= mysql_query("SELECT * FROM professor WHERE numero_informatico =".$numero_informatico);
        return($result);



script listar :




       $numero_informatico = gestalunosBD::getInstance()->professor_n(mysql_real_escape_string($_SESSION["username"]));
       $result= gestalunosBD::getInstance()->n_informatico("numero_informatico");
       while($row = mysql_fetch_array($result))
       {


           strip_tags($row["numero_informatico"],'<br><p><h1>');
           echo "<tr><td>" . $row["numero_informatico"]."</td>";
           strip_tags($row["nome"],'<br><p><h1>');
           echo "<td>" . $row["nome"]."</td>";
           strip_tags($row["telefone"],'<br><p><h1>');
           echo "<td>" . $row["telefone"]."</td>";
           strip_tags($row["e_mail"],'<br><p><h1>');
           echo "<td>" . $row["e_mail"]."</td>";
           strip_tags($row["morada"],'<br><p><h1>');
           echo "<td>" . $row["morada"]."</td>";
           strip_tags($row["data_nascimento"],'<br><p><h1>');
           echo "<td>" . $row["data_nascimento"]."</td>";
           strip_tags($row["sexo"],'<br><p><h1>');
           echo "<td>" . $row["sexo"]."</td>";
           $numero_informatico = $row["numero_informatico"];

?>

<td>
           <form name="editar_professor" action="editar_professor.php" method="GET">
           <input type="hidden" name="numero_informatico" value="<?php echo $numero_informatico;?>"/>
           <input type="submit" name="editar_professor" value="Editar"/>
           </form>

           </td>
           <td>

           <form name="apagarprofessor" action="apagar_professor.php" method="POST">
           <input type="hidden" name="numero_informatico" value="<?php echo $numero_informatico; ?>"/>
           <input type="submit" name="apagarprofessor" value="Apagar"/>
           </form>

           </td>
  <?php
           echo "</tr>";

      }

       ?>


           </table>
           </table>
   </body>
</html>
Edited by scorch
Adicionado Geshi.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.