I am new in programming in PHP and I have small problem(for me it is big
The index.php page looks like this:
<?php
$result = mysql_query("SELECT * FROM pages ORDER BY id DESC LIMIT 10");
while ($page = mysql_fetch_array($result)) {
echo "<a href=\"news.php?page=" . urlencode($page["id"]) . "\" class='news'>{$page["newsname"]}</a><br />";
echo "<h5 style=' font-size: 10px; color: black;'>{$page["date"]}</h5><hr style='margin: 5px auto 5px;' />";
}
?>
This is index page where we have list of new news!
Here is page which needs to open content of that news:
news.php
<?php
if (isset($_GET['id']))
{
$result = mysql_query("SELECT id, newsname, text FROM pages WHERE `id`='".$_GET['id']."'");
$page = mysql_fetch_array($result);
echo $page['newsname']."<br />".$page['tekst'];
}
?>