Make a query to my database which gives me the following results:
[400,600]
Note: this query is done with mysqli where obviously in array it is called from a loop
while
in this way$columna_gastos['costo_gastos']
Then I need the response values of that array can be added together and the result is as follows:
1000
This is the calculation code:
while($columna_gastos = $resultado_del_query_gasto->fetch_assoc()){
if(true){
$total_gasto[$contador_get_values_gastos][0] = $datos_de_viaje_cond_clie[$contador_get_values_gastos][0];
$total_gasto[$contador_get_values_gastos][1] = $total_gasto[$contador_get_values_gastos] + $columnas_de_gastos['PRECIO_GASTO'];
$contador_get_values_gastos = $contador_get_values_gastos + 1;
}
}
The error is in this line of code:
$total_gasto[$contador_get_values_gastos][1] = $total_gasto[$contador_get_values_gastos] + $columnas_de_gastos['PRECIO_GASTO'];