Thanks very much for your reply, really appreciate it.
However I'm a bit lost now.
I think I'm doing what you said right, here is my code:
<?php
while($row = mysql_fetch_array($result)){
if ($cur_catid != $row['productTypeId']){ //first record in this category
echo "<h2>" . $row['productTypeName'] . "</h2><ul>";
}
echo "<li>" . $row['CatName'] . "</li>";
$cur_catid = $row['productTypeId']; //I've put this back
}
echo "</ul>"; // echo just below the last closing curly bracket?!
?>
It does'nt seem to close of each UL tag still,
Really sorry for not understanding properly, thanks again for your reply