i dont think you need to add a while() within a while() .. the second fetch will loop since its already inside a while.
try:
while ($rowAllAttributes = mysql_fetch_object($resultAllAttributes))
{
$attributeUID = $rowAllAttributes->UID;
echo "<input type=\"checkbox\" name=\"" . $attributeUID . "\"";
$rowAttributes = mysql_fetch_object($resultAttributes);
if ($attributeUID == $rowAttributes->UID)
{
echo " CHECKED";
}
echo ">" . $rowAllAttributes->name . "<br>\n";
}