Welcome Guest, Not a member yet? Register   Sign In
How can i use variable from diffrent foreach to get value by adding 2 variable itself
#6

(09-28-2015, 06:27 PM)freddy Wrote: Thanks also pdt it give same result too, May God Bless you, +1 for you Big Grin 

Maybe I misunderstand something. If you use foreach your way, you only get the last row of the result set. So it something similar to following without the foreach:

PHP Code:
$untung $sum->last_row()->jumlah_item;
$ongkir $sumongkir->last_row()->total;
$total $untung $ongkir
Reply


Messages In This Thread
Declare variables outside of loop - by JayAdra - 09-28-2015, 05:18 PM
RE: How can i use variable from diffrent foreach to get value by adding 2 variable itself - by pdthinh - 09-28-2015, 06:50 PM



Theme © iAndrew 2016 - Forum software by © MyBB