2
In the PHP I’m declaring my variable like this:
$id_produto = $dados["id_produto".$input.""];
Where $inc is increment within the loop and the $dados["id_produto".$input.""] should return something like $dados["id_produto1"], $dados["id_produto2"] ...
It is correct to declare the variable this way?
wrong would be a strong word... But I think you could generate a multidimensional array. So:
$produtos[0]["id_produto"] = 1...$produtos[0]["nome"] = "panela"...$produtos[1]["id_produto"] = 2...$produtos[1]["nome"] = "prato"– Andrei Coelho
But it all depends on what you intend to do...
– Andrei Coelho
so... is that in my application I have several inputs with the id: id_productN... and I will take the value of each id of these and play inside a while, so would have something like $id_product = $data["id_product". $input."];
– Nosredna
that $id_product = $data["id_product". $input." ]; would have to return me something like: $id_product = id_product1 <== relating to the value of input 1 and so on
– Nosredna