1
I have the following schedule, which brings the price of each selected item:
for($x=1;$x<=4;$x++){
if($_POST['p'.$x] != '0'){
$sql = "SELECT produto, preco FROM produtos WHERE p = '".$px."'";
$result = $db->query($sql);
$obj = mysqli_fetch_object($result);
$preco = $obj->preco;
echo $preco.'<br/>';
}
}
He brings for example:
10
11
15
I wish that after I brought all this up he’d put it all together in another variable to bring:
10
11
15
36
How can I do?
Perfect, I figured it could be something really simple, thank you very much!
– Leandro Marzullo