How to print a mester detail form with HTML (free format)

Hello, I’m trying to print a master detail form by html (free format) and I can not get all the details (10 data rows by detail) my code only brings the first data row, any suggestions?


$i=0;
for($i=0 ; $i<10; $i++){
sc_lookup(ds, "SELECT articulo, cantidad FROM detalle_deposito WHERE id_entrega_deposito = [id]" );
$articulo = {ds[0][0]};
$cantidad = {ds[0][1]};
}

You must to calculate el count(*) for your details. and then create a loop with the details.

In your SQL the [id] does not change? (for the FOR?), So always show same values.