Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $servername = "localhost";
- $username = "root";
- $password = "";
- $dbname = "xxx";
- // Create connection
- $conn = mysqli_connect($servername, $username, $password, $dbname);
- // Check connection
- if (!$conn) {
- die("Connection failed: " . mysqli_connect_error());
- }
- $sql = "SELECT title, link, area, shortdesc, period, id FROM tabella_file";
- $result = mysqli_query($conn, $sql);
- if (mysqli_num_rows($result) > 0) {
- // output data of each row
- while($row = mysqli_fetch_assoc($result)) {
- echo "<table border=1>
- <tr>";
- echo "<td>TITLE: " . $row["title"]. "</td><td>SHORTDESC: ". $row["shortdesc"]."</td><td>".$row["period"]. "</td><td><a href=\"" . $row['link'] . "\" >" . "GO TO THE PROJECT" . '</a>'."<br>";
- echo " </tr>
- </table>";
- }
- } else {
- echo "0 results";
- }
- mysqli_close($conn);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement