Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- } elseif ($n == "lista") {
- // $k = $_GET['k'];
- // echo "<p>Wartość k: $k</p>";
- include_once ("parameters.php");
- $connection = pg_connect("host=$hostname user=$username dbname=$database password=$password");
- $query = "select * from reflection";
- $result = pg_exec($connection,$query);
- $numRows = pg_numrows($result);
- $numCols = pg_numfields($result);
- echo '
- <table class="table table-hover">
- <thead>
- <tr>
- <th scope="col">#</th>
- <th scope="col">Tytuł</th>
- <th scope="col">Treść</th>
- <th scope="col">Księga</th>
- </tr>
- </thead>
- <tbody>
- ';
- for($i = 0; $i < $numRows; $i++){
- $wiersz = pg_fetch_array($result,$i);
- $bookId = $wiersz[1];
- echo '<td>'.($i+1).'</td>';
- echo '<td>'.$wiersz[2].'</td>';
- echo '<td>'.$wiersz[3].'</td>';
- echo '<td><span><a href ="./index.php?k='.$wiersz[1].'"> '.$wiersz[1].' </span></td>';
- echo "</tr>";
- }
- echo '
- </tbody>
- </table>
- ';
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement