Advertisement
Guest User

Untitled

a guest
Sep 28th, 2017
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.51 KB | None | 0 0
  1. <?php
  2. $user = 'root';
  3. $password = '';
  4. $database = 'stomatologia';
  5.  
  6. mysql_connect(localhost,$user,$password);
  7. @mysql_select_db($database) or die("Nie znaleziono bazy danych");
  8.  
  9. $query="SELECT * FROM rok";
  10. $result=mysql_query($query);
  11.  
  12. $num=mysql_numrows($result);
  13. ?>
  14. <h2>Wyswietlanie</h2>
  15. <form action="pokaz.php" method="post">
  16. Rok:<select name="rok">
  17.         <?php
  18.             $i=0;
  19.             while ($i < $num) {
  20.                 $variable=mysql_result($result,$i,"Rok");
  21.                 echo '<option>'.$variable.'</option>';
  22.                 $i++;
  23.             }
  24.         ?>
  25.     </select>
  26. </form>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement