linkvz/index.php

11 lines
244 B
PHP

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