$pro1="Tubo Estructural";
$pro2= "Protector De Corriente";
$sql= "SELECT producto, SUM(cantidad) as monto FROM grafica WHERE producto = '$pro1' ";
$query= mysqli_query($conexion,$sql);
$sql1= "SELECT producto, SUM(cantidad) as monto FROM grafica WHERE producto = '$pro2'";
$query1= mysqli_query($conexion,$sql1);
$row=mysqli_fetch_array($query);
$row1=mysqli_fetch_array($query1);
echo $row['producto'].' '.$row['monto'];
echo $row1['producto'].' '.$row1['monto'];
I clarify that is what I want if it works like this, but I see how to render information and I do not think it's the right way, is there a way to do all that in a single consultation?