I think you might want something like:
<?php
echo "Products Related: ";
$shown = array();
?>
<?php
while (!$eCart1->EOF()) {
?>
<?php
if (!in_array($eCart1->DisplayInfo("eCartCatID"), $shown)) {
$shown[] = $eCart1->DisplayInfo("eCartCatID");
?>
<?php
$Recordset1 = new WA_MySQLi_RS("Recordset1",$convacc_cx,1);
$Recordset1->setQuery("SELECT Product_Name, Cat_ID FROM eCart_products WHERE Cat_ID = " . $eCart1->DisplayInfo("eCartCatID"));
$Recordset1->execute();
?>
<?php while (!$Recordset1->atEnd()) { ?>
<ul>
<li class="itemname" class="eC_ItemName">
<?php
echo $Recordset1->getColumnVal("Name");
?></li></ul>
<?php
$Recordset1->MoveNext();
}
$Recordset1->MoveFirst();
?>
<?php
}
?>
<?php
$eCart1->MoveNext();
}
$eCart1->MoveFirst();
?>