I have a mysql query:
while ($qry = mysql_fetch_array($res)){
$id_prod = $qry["id"];
$id_venta = $qry["id_venta"];
$idcl = $qry["id_cl"];
$garzon = $qry["usuario"];
$valor_total = $qry["valor"];
$prod= $qry['producto']; --> esta puede tener uno o mas valores
}
What I need with this query, generate an array of $ prod, send it and receive it by post on another page. what gives me back said variables is Array. I have tried several options but none works. among them:
$data = array();
$data[$qry['producto']] = $qry['producto'];
and send it in the form like this:
<input type="hidden" name="prod[]" value="<?=$data?>" >
and receiving asi (ejecutor.php)
$prod = $_POST["prod"];
$i = 1;
foreach ($prod as $e)
{
echo "<br>".$e;
$i++;
}
I have read and tried many alternatives and none works as it should. As mentioned above, the variable $ data can have 1 to X records, for example: Product 1 can sell 1 to X quantity. Product 2 can sell 1 quantity. and so with one or more products per sales. I hope you can guide me.