Thanks for taking the time to look in johanafm. If I fully understand your solution, then I would need to manually create and update article.php each time the database was updated? That wouldn't be viable as it needs to be user friendly, I won't always be the one updating it, and I would need to use the same solution but on a larger scale on my news page where all the articles from the news table are shown.
My code for this section currently looks like this
<?php
$con = mysql_connect("localhost","username","password");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("database", $con);
//get the latest items
$getitem = mysql_query("SELECT id, title, blurb, article FROM news ORDER BY id DESC LIMIT 4")
or die(mysql_error());
while ($rows = mysql_fetch_array($getitem)) {
extract($rows);
$rows['n_sets_per_page'] = 2;
echo "<h3>$title</h3>$blurb<br /><hr />";
}
?>
What I would really like to do when I echo the query results, is have something like this
echo "<h3><a href="/articles.php?id=$id">$title</a></h3>$blurb<br /><hr />";
but I've no idea how to go about implementing this. Any suggestions?
Thanks again for your help guys