I am using laravel and I do the following query:
$cantidadDeposito = DB::select('SELECT SUM(cantidad) FROM `finanzas` WHERE miembro = ?', [$idNombre]);
print_r ($cantidadDeposito);
Which gives me as a result:
stdClass Object ( [SUM(cantidad)] => 750 )
how can i just read the number?
Thanks.
I recommend that you use an alias in your query like this:
and then to print it: