Advertisement
Guest User

Za Bagija

a guest
Apr 6th, 2016
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. <html>
  2. <head>
  3. <meta charset="UTF-8">
  4. <title></title>
  5. </head>
  6. <body>
  7. <?php
  8.  
  9. $username = "root";
  10. $password = "root";
  11. $hostname = "localhost";
  12.  
  13. //connection to the database
  14. $dbhandle = mysql_connect($hostname, $username, $password)
  15. or die("Unable to connect to MySQL");
  16. echo "Connected to MySQL<br>";
  17. //select a database to work with
  18. $selected = mysql_select_db("skola",$dbhandle)
  19. or die("Could not select skola");
  20. ?>
  21.  
  22. <?php //phpinfo();
  23. mysql_select_db("skola");
  24. $result=mysql_query("SELECT ID, Ime FROM studenti");
  25. while($row=mysql_fetch_array($result, MYSQL_ASSOC));{
  26. echo $row["id"]."".$row["ime"]."<br>";
  27. }
  28. mysql_free_result($result);
  29. mysql_close($link);
  30. ?>
  31. </body>
  32. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement