MySQL + PHP Problem<

liunx

Guest
function getlist($cat)
{
$getlist = mysql_query("SELECT * FROM code WHERE category='$cat' ORDER BY date DESC");

$output = mysql_fetch_array($getlist);

echo "<a href=http://www.htmlforums.com/archive/index.php/\"get.php?id=$output[id]\">$output[title]</a> - Added: $output[date]<br>";
echo "$output[description]<br><hr>";
}


The above funtion will show a summary of code snippets in a given category and provide a link the each code snippet. However, I have two code snippets in the same category and only one is shown.

Any help is appriciated. The URL is... <!-- m --><a class="postlink" href="http://www.phplanet.co.uk/code/databases.phpyou">http://www.phplanet.co.uk/code/databases.phpyou</a><!-- m --> have to fetch more than 1 row...

while ($output = mysql_fetch_array($getlist))
{
echo "<a href=http://www.htmlforums.com/archive/index.php/\"get.php?id=$output[id]\">$output[title]</a> - Added: $output[date]<br>";
echo "$output[description]<br><hr>";
}Of course, thanks a lot, I should have know that. Thanks a lot.
 
Back
Top