jib Posted June 2, 2008 Share Posted June 2, 2008 G'day I am a bit confused, I was busy working on my site until I hit this wall. Basically the problem is this, there is an if statement with 3 possible outputs but it always just prints the first output. The code is like the following if ($Category = $Cat1) { print stuff } elseif ($Category = $Cat2) { print other stuff } else { print more other stuff } now i put in commands to check that the category values are correct but it still always just spits out the result to the first IF even if the Category = the second value (cat2) What am I missing 0_o Link to comment https://forums.phpfreaks.com/topic/108325-solved-simple-ifs-am-i-retarded/ Share on other sites More sharing options...
soycharliente Posted June 2, 2008 Share Posted June 2, 2008 OMG!!! = is setting something to be something else == is a test for equality What do you think the problem is? Link to comment https://forums.phpfreaks.com/topic/108325-solved-simple-ifs-am-i-retarded/#findComment-555360 Share on other sites More sharing options...
jib Posted June 2, 2008 Author Share Posted June 2, 2008 I bloody knew it! I am a retard tar always something stupid Link to comment https://forums.phpfreaks.com/topic/108325-solved-simple-ifs-am-i-retarded/#findComment-555361 Share on other sites More sharing options...
soycharliente Posted June 2, 2008 Share Posted June 2, 2008 You're not retarded. You're just tired from coding and needed a fresh pair of eyes to notice a small syntax error that you don't normally make. Happens to everyone. No worries. Nice use of "bloody". I'll be in Oxford in 3 weeks. I suppose I'll be hearing a lot of that soon. Link to comment https://forums.phpfreaks.com/topic/108325-solved-simple-ifs-am-i-retarded/#findComment-555363 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.