Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <meta charset="UTF-8">
- <title></title>
- </head>
- <body>
- <?php
- $username = "root";
- $password = "root";
- $hostname = "localhost";
- //connection to the database
- $dbhandle = mysql_connect($hostname, $username, $password)
- or die("Unable to connect to MySQL");
- echo "Connected to MySQL<br>";
- //select a database to work with
- $selected = mysql_select_db("skola",$dbhandle)
- or die("Could not select skola");
- ?>
- <?php //phpinfo();
- mysql_select_db("skola");
- $result=mysql_query("SELECT ID, Ime FROM studenti");
- while($row=mysql_fetch_array($result, MYSQL_ASSOC));{
- echo $row["id"]."".$row["ime"]."<br>";
- }
- mysql_free_result($result);
- mysql_close($link);
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement