Advertisement
Guest User

Untitled

a guest
Jan 17th, 2017
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>User Info</title>
  6. </head>
  7. <body>
  8. <h1>LIST OF DETAILS:</h1>
  9. <table>
  10. <thead>
  11. <tr>
  12. <td>Username</td>
  13. <td>Email</td>
  14. <td>Address</td>
  15. <td>Phone</td>
  16. <td>Bio</td>
  17. </tr>
  18. </thead>
  19. <tbody>
  20. <?php
  21. $host = "localhost";
  22. $user = "test1";
  23. $pass = "test1*";
  24. $db = "1kozlovsas";
  25.  
  26. $con = pg_connect("host=$host dbname=$db user=$user password=$pass")
  27. or die ("Could not connect to server\n");
  28.  
  29. $query = "SELECT username FROM ass1dat";
  30. $rs = pg_query($con, $query) or die("Cannot execute query: $query\n");
  31.  
  32. while ($row = pg_fetch_row($rs)) {
  33. echo '<tr>
  34. <td>
  35. <a href="viewusername.php?username='.$row[0].'">
  36. <button type="button" class="btn btn-info">View Username</button>
  37. </a>
  38. </tr>';
  39. }
  40. pg_close($con);
  41. ?>
  42. </tbody>
  43. </table>
  44.  
  45. </body>
  46. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement