Guest User

Untitled

a guest
May 25th, 2018
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. <?php
  2. include"conectar.php";
  3.  
  4.  
  5.  
  6. /// codigo para fazer leitura do banco de dados
  7. /// incluindo ?php echo $cpf ? entre <> na tabela onde ficará o registro
  8.  
  9.  
  10.  
  11. $query="select nome, cpf from associados ";
  12. $stmt=mysqli_query($con,$query);
  13. if($stmt) {
  14.  
  15. $today = date("d.m.y");
  16. } else {
  17. mysqli_rollback($con);
  18. echo "Transaction rolled back.<br />";
  19. }
  20.  
  21.  
  22. while($row=mysqli_fetch_array($stmt) )
  23. {
  24. $cpf = $row['cpf'];
  25. $nome = $row['nome'];
  26. **$endereco = $row['endereco'];**
  27.  
  28. }
  29.  
  30.  
  31. mysqli_close($con);
  32. ?>
  33.  
  34.  
  35. onde insiro o resultado da pesquisa
  36. ----------------------------------
  37.  
  38.  
  39. <tr>
  40. <td> <?php echo $cpf ?> </td>
  41. <td><?php echo $nome ?></td>
  42. <td><?php echo $endereco ?></td></td>
  43. </tr>
Add Comment
Please, Sign In to add comment