Mutley Posted March 23, 2007 Share Posted March 23, 2007 $p2_total1 = '-5'; if(p2_total1 < '1') { $neg2_total1 = '2'; } else { $neg2_total1 = '0'; } echo $neg2_total1; I get 0? Why is this? Link to comment https://forums.phpfreaks.com/topic/44051-solved-smaller-than-wont-work/ Share on other sites More sharing options...
per1os Posted March 23, 2007 Share Posted March 23, 2007 if(p2_total1 < '1') { should be if($p2_total1 < '1') { You forgot to add the "$" before the variable. Link to comment https://forums.phpfreaks.com/topic/44051-solved-smaller-than-wont-work/#findComment-213900 Share on other sites More sharing options...
Mutley Posted March 23, 2007 Author Share Posted March 23, 2007 Damn it, I'm getting dumber by the day. Frost to the rescue again. Link to comment https://forums.phpfreaks.com/topic/44051-solved-smaller-than-wont-work/#findComment-213905 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.