Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <body>
- <?php
- $dbh = pg_connect("dbname=dziennik user=krzklin password=franekjordan93 host=localhost");
- $query = "Select * from nauczyciel";
- $wynik = pg_query($dbh,$query);
- $liczba_kolumn = pg_num_fields($wynik);
- $liczba_wierszy = pg_num_rows($wynik);
- echo "<TABLE border width=1>";
- echo "<TABLE border width=1>";
- echo "<TR>";
- echo "<TABLE border width=1>";
- echo "<TR>";
- for($k =0;$k<$liczba_kolumn;$k++)
- {
- echo "<TD>";
- echo pg_field_name($wynik,$k);
- echo "</TD>";
- }
- echo "<td>Usun</td><td>Edytuj</td><td>Awansuj</td></TR>";
- for($w =0;$w<$liczba_wierszy;$w++)
- {
- echo "<TR>";
- for($k =0;$k<$liczba_kolumn;$k++)
- {
- echo "<TD>";
- echo pg_fetch_result($wynik,$w,$k);
- echo "</TD>";
- }
- }
- $idos = pg_fetch_result($wynik,$w,$liczba_kolumn-1);
- echo "<form action=delos.php method=POST>
- <input type=hidden name=idos value=$idos>
- <td> <input type=submit name=usun value=Usun></td></form>";
- echo "<form action=edos.php method=POST>
- <input type=hidden name=idos value=$idos>
- echo "<form action=edos.php method=POST>
- <input type=hidden name=idos value=$idos>
- <td> <input type=submit name=edytuj value=Edytuj></td></form>";
- echo "<form action=awans.php method=POST>
- <input type=hidden name=idos value=$idos>
- <td> <input type=checkbox name=Awansuj value=Awansuj> <input type=submit name=O$
- <tr>
- <td> <input type=checkbox name=Awansuj value=Awansuj> <input type=submit name=O$
- <tr>
- //table
- <form action=dodos.php method=POST>
- Dodaj nowego nauczciela do bazy: <br/>
- Imie: <input type=text name=imie>
- Nazwisko: <input type=text name=nazw>
- Przedmiot: <input type=text name=dzia>
- ID: <input type=text name=id>
- <input type=submit name=Dodaj value=Dodaj>
- </form>;
- pg_close($dbh);
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment