# Maths difficulties

## Recommended Posts

Hi if ive made a variable how do i tell it to be less than or equal to another variable ?

currently im using

\$lowhigh_price = ( <= 0.75 * \$av_price);

but it tells me there is something wrong

##### Share on other sites

\$low  =5;

\$high = 8;

if(\$low <= \$high){

echo 'Low is less that or equal to high';

}else{

echo 'High is greater but not equal to low ';

}

##### Share on other sites

Hi thanx for the reply im not sure how i wodul fir that in though as i want it to be put into a switch so that on each case ( if statement) it will search the datase for amounts that are <= the variable amount

atm ive got this

\$lowav_price = 0;

\$medlowav_price = 0.75 * \$av_price;

case '1' : \$price_low = \$lowav_price; \$price_high = \$medlowav_price ;

so would i leave the variables as say

\$lowav_price = 0;

\$medlowav_price = 0.75 * \$av_price;

and then change

case '1' : \$price_low = \$lowav_price; \$price_high = (<= \$medlowav_price)

thankx

##### Share on other sites

This thread is more than a year old. Are you sure you have something important to add to it?

## Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

×   Pasted as rich text.   Restore formatting

Only 75 emoji are allowed.