spearchilduser Posted November 30, 2011 Share Posted November 30, 2011 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 hlep please Link to comment https://forums.phpfreaks.com/topic/252119-maths-difficulties/ Share on other sites More sharing options...
dreamwest Posted November 30, 2011 Share Posted November 30, 2011 $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 '; } Link to comment https://forums.phpfreaks.com/topic/252119-maths-difficulties/#findComment-1292579 Share on other sites More sharing options...
spearchilduser Posted November 30, 2011 Author Share Posted November 30, 2011 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 Link to comment https://forums.phpfreaks.com/topic/252119-maths-difficulties/#findComment-1292580 Share on other sites More sharing options...
dreamwest Posted November 30, 2011 Share Posted November 30, 2011 http://www.wizecho.com/nav=php&s=switch http://www.wizecho.com/nav=php&s=operators Link to comment https://forums.phpfreaks.com/topic/252119-maths-difficulties/#findComment-1292582 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.