Advertisement
Adriano_back

index.php

Oct 19th, 2017
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.43 KB | None | 0 0
  1. <?php
  2. namespace connections;
  3. require_once 'ConexaoDB.php';
  4.  
  5. $conn = new ConexaoDB();
  6.  
  7. try{
  8. //$result = $conn->getConn()->exec("insert into produto");
  9. $result = $conn->getConn()->query("SELECT * FROM produto");
  10.    
  11. if($result){
  12.     foreach ($result as $row){
  13.        echo $row['descricao'] . $row['codigo_barras'];
  14.         }
  15.     }
  16. }
  17.  
  18. catch (PDOException $e){
  19.     print"erro: " . $e->getMessage() . "<br />";
  20. }
  21.  
  22. $conn = null;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement