Ηow can I implement a clone of Digg? [closed]

You have to pass parameter between two pages So first of all your have to edit add link on it

<?php
try 
{
    $pdo = new PDO('mysql:host=localhost;dbname=informal','vad','6989');
    $pdo->setAttribute(PDO::ATTR_ERRMODE,PDO::ERRMODE_EXCEPTION);
    $pdo->exec('SET NAMES "utf8"');
} catch(PDOException $e) {
    echo $e->getMessage();
}

$sql="SELECT title,content FROM postID";
$result = $pdo->query($sql);
while($row = $result->fetch())
{
    echo "<a href=anotherpage.php?id=".$row['id'].">".$row['title'] . "</a><br />";
    echo $row['content'] . "<br />";
}
?>

Then on the other page you have to query with your passed ID .. And then you have to fetch data with it

Browse More Popular Posts

Leave a Comment