Hola Cadetill.
No se exactamente que te pasa pero en lugar de usar un bucle for next para recorrer una consulta, usa un while
Código:
<table>
<?php
while ($fila = mysql_fetch_object($sql)){
?><tr><td><?php
print $fila->CODIGO; ?></td><td><?php
print $fila->DESCRIPCION; ?></td><tr>
<?php
}
?>
</table>