Bamos Ahora A resolver tu probema:
Arcivo formulario.php
Código PHP:
<html>
<head>
<title>Adivina</title>
</head>
<body>
<table width="22%" border="1">
<tr>
<td width="13%">Producto</td>
<td width="13%">Cantidad</td>
<td width="74%"> </td>
</tr>
<?php
//Haces tu coneccion y tu consulta de la fdorma que desees
$consulta="select * from trabla";
$resultado=mysql_query($consulta);
while ($fila=mysql_fetch_array($resultado)){
?>
<form name="como" method="post" action="pagina2.php">
<tr>
<td><input type="hidden" value="<?=$fila["codigo"]?>" name="codigo"/> <?=$fila["nombreproducto"]?></td>
<td><input type="text" name="cantidad" /> </td>
<td><input type="submit" value="Agregar" /></td>
</tr>
<?
} //final de bucle
mysql_free_result();
?>
</table>
</body>
</html>
Ahora la pagiina que recibe el formulario.....
pagina2.php
Código PHP:
echo "Producto ".$_POST["codigo"]." Cantidad =".$_POST["cantidad"];
// Luego haces lo que desee
Por favor informanos si te funciono, mejoralo y luego lo compartes