Here is the code:
---------
<HTML>
<HEAD>
<TITLE></TITLE>
<META name="description" content="">
<META name="keywords" content="">
<META name="generator" content="CuteHTML">
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#800080">

<?php

include("/home2/ianc/phplib/articles.inc");
mysql_select_db('ianc_articles');


$article = mysql_query("SELECT C.ID as CatID, C.Name as CatName, S.ID as SubID, S.Name as SubName, " .
"S.CID as SubCID FROM categories as C, subcategories as S WHERE S.CID=$id");
if (!$article) {
echo("<P>Error retrieving authors from database!<BR>".
"Error: " . mysql_error());
exit();
}

$title = mysql_fetch_array($article);
$titlename = $title["CatName"];
echo("<font size='5'>$titlename</font><br><br>");

while ($select = mysql_fetch_array($article)) {
$subid = $select["SubID"];
$subname = $select["SubName"];
echo("<a href='subcat.php?id=$subid'>$subname</a><br>");
}

?>

</BODY>
</HTML>
----------

basically, as you can see at: http://www.pcreview.co.uk/category.php?id=2

It does really funny loops and i have no idea why. Can anyone help me out on this?