Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <title> Wynik query </title>
- <meta charset="UTF-8">
- </head>
- <body>
- <?php
- $username="root";
- $password="root";
- $database="frimaos";
- mysql_connect('localhost',$username,$password);
- @mysql_select_db($database) or die ("Nie ma baz w bazach");
- $query="SELECT * FROM `pracownicy`";
- $wynik=mysql_query($query);
- $num=mysql_numrows($wynik);
- mysql_close();
- ?>
- <table border="1">
- <tr>
- <th> id </th>
- <th> nazwisko </th>
- <th> imie </th>
- <th> pesel </th>
- <th> stanowisko </th>
- </tr>
- <?php
- $i=0;
- while($i<$num)
- {
- $id_p=mysql_result($wynik,$i,"id_p");
- $nazwisko=mysql_result($wynik,$i,"nazwisko");
- $imie=mysql_result($wynik,$i,"imie");
- $pesel=mysql_result($wynik,$i,"pesel");
- $stanowisko=mysql_result($wynik,$i,"stanowisko");
- ?>
- <tr>
- <td> <? echo $id_p; ?> </td>
- <td> <? echo $nazwisko; ?> </td>
- <td> <? echo $imie; ?> </td>
- <td> <? echo $pesel; ?> </td>
- <td> <? echo $stanowisko; ?> </td>
- </tr>
- <?php
- $i++;}
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement