Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- //konekcija do database
- $db_host = "localhost"; //obicno je localhost
- $db_username = "root"; //username za bazu
- $db_pass = "123456"; //password za bazu
- $db_name = "gamersbaza"; //ime baze
- mysql_connect("$db_host","$db_username","$db_pass") or die ("could not connect to mysql");
- mysql_select_db("$db_name") or die ("no database");
- ?>
- <?php
- $row=mysql_fetch_array(mysql_query("SELECT * FROM igre ORDER BY id"));
- //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- $id = $row["id"]; // Ispis podataka
- $ime_igre= $row["ime_igre"]; // Ispis podataka
- $link_igre = $row["link_igre"]; // Ispis podataka
- mysql_free_result($query);
- mysql_close();
- ?>
- <?php
- echo "<table border='1'>
- <tr>
- <th> ID </th>
- <th> Ime Igre </th>
- <th> Link Igre </th>
- </tr>";
- echo "<tr>";
- echo "<td>" . $row['id'] . "</td>";
- echo "<td>" . $row['ime_igre'] . "</td>";
- echo "<td>" . $row['link_igre'] . "</td>";
- echo "</tr>";
- echo "</table>";
- ?>
Advertisement
Add Comment
Please, Sign In to add comment