Advertisement
Guest User

Untitled

a guest
Apr 9th, 2017
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.75 KB | None | 0 0
  1. <?php
  2.  
  3. $username = 'PROIECT';
  4. $password = 'PROIECT';
  5. $connection_string = 'localhost/xe';
  6.  
  7. $connection = oci_connect(
  8. $username,
  9. $password,
  10. $connection_string
  11. );
  12.  
  13. If (!$connection)
  14. {
  15.     die('Baza de date nu a putut fi deschisa: '.mysql_error());
  16. }
  17.  
  18. $sql = oci_parse($connection,"select * from info_user where email is not null");
  19. $r = oci_execute($sql);
  20. print "<table border='1'>\n";
  21. while($row = oci_fetch_array($sql, OCI_ASSOC+OCI_RETURN_NULLS))
  22. {
  23.     print "<tr>\n";
  24.     foreach($row as $item)
  25.     {
  26.       print "    <td>" . ($item !== null ? htmlentities($item, ENT_QUOTES) : "&nbsp;") . "</td>\n";
  27.     }
  28.     print "</tr>\n";
  29. }
  30. print "</table>\n";
  31.  
  32. oci_free_statement($sql);
  33. // Close connection
  34. oci_close($connection);
  35.  
  36. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement