linkvz/index.php

11 lines
238 B
PHP

<?php
$pdo = new PDO('mysql:host=localhost;dbname=links', 'root', 'test');
$sql = "SELECT * FROM link";
foreach ($pdo->query($sql) as $row) {
echo '<a href="'.$row['link_url'].'" target="_blank">'.$row['link_name'].'</a><br>';
}
?>