Advertisement
Guest User

Untitled

a guest
Nov 28th, 2017
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.22 KB | None | 0 0
  1. } elseif ($n == "lista") {
  2. // $k = $_GET['k'];
  3. // echo "<p>Wartość k: $k</p>";
  4. include_once ("parameters.php");
  5. $connection = pg_connect("host=$hostname user=$username dbname=$database password=$password");
  6. $query = "select * from reflection";
  7. $result = pg_exec($connection,$query);
  8. $numRows = pg_numrows($result);
  9. $numCols = pg_numfields($result);
  10. echo '
  11. <table class="table table-hover">
  12. <thead>
  13. <tr>
  14. <th scope="col">#</th>
  15. <th scope="col">Tytuł</th>
  16. <th scope="col">Treść</th>
  17. <th scope="col">Księga</th>
  18. </tr>
  19. </thead>
  20.  
  21. <tbody>
  22. ';
  23. for($i = 0; $i < $numRows; $i++){
  24. $wiersz = pg_fetch_array($result,$i);
  25. $bookId = $wiersz[1];
  26. echo '<td>'.($i+1).'</td>';
  27. echo '<td>'.$wiersz[2].'</td>';
  28. echo '<td>'.$wiersz[3].'</td>';
  29. echo '<td><span><a href ="./index.php?k='.$wiersz[1].'"> '.$wiersz[1].' </span></td>';
  30. echo "</tr>";
  31.  
  32. }
  33. echo '
  34. </tbody>
  35. </table>
  36. ';
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement