I want to execute this statement
$Data=$cash-$tax
The problem is that the tax differs for various ranges of cash
exactly as shown below.
cash range ————> tax
5,000 – 30,000——–> 700
30,001- 60,000——– > 1,000
60,001 – 125,000 ——-> 1,600
125,001 – 250,000 ———> 3,000
250,001 – 500,000 ——– > 5,000
500,001 – 1,000,000———> 9,000
what code can i use to explain this. Ive tried if else
if($cash >=0 && <=30000) $tax=700;
elseif($cash >=30001 && <=60000) $tax=1000;
elseif($cash >=60001 && <=125000) $tax=1600;
elseif($cash >=125001 && <=250000) $tax=3000;
elseif($cash >=250001 && <=500000) $tax=5000;
else($cash >=500001 && <=1000000) $tax=9000;
endif
This is not working i dont know where the problem is.
You need the full comparison expression for every item.
You can’t do
if (($cash > 20) && (< 50)).$cashmust be part of every expression:This gets really fun if you try to apply the same logic in Delete queries:
Where did all my users go?