floppydrivez Posted March 2, 2007 Share Posted March 2, 2007 I wanna use something like the following, but have had no luck with it. }elseif(date("m") <= 06 || $czdconf[strtolower(fquart)] <= $total_donated_fquart){ I know all variables can operate as pairs, but not together with OR. Any suggestions? Link to comment https://forums.phpfreaks.com/topic/40804-small-issue-with-elseif/ Share on other sites More sharing options...
micah1701 Posted March 2, 2007 Share Posted March 2, 2007 should: [strtolower(fquart)] be: [strtolower($fquart)] or: [strtolower("fquart")] is fquart a $variable or a "string" ? Link to comment https://forums.phpfreaks.com/topic/40804-small-issue-with-elseif/#findComment-197567 Share on other sites More sharing options...
floppydrivez Posted March 2, 2007 Author Share Posted March 2, 2007 No its an array for the config table. All items work seperately and without the OR operator. This I have tested. Link to comment https://forums.phpfreaks.com/topic/40804-small-issue-with-elseif/#findComment-197569 Share on other sites More sharing options...
btherl Posted March 2, 2007 Share Posted March 2, 2007 There's nothing wrong there.. if it works without the or, it will work with the or. I suggest you double check that it works without the or. Try printing out the values of each variable just before you do the comparison. Also, you should use either 'fquart' (for a constant) or $fquart (for a variable). Link to comment https://forums.phpfreaks.com/topic/40804-small-issue-with-elseif/#findComment-197573 Share on other sites More sharing options...
floppydrivez Posted March 2, 2007 Author Share Posted March 2, 2007 Yeah I tried all that before, but again to be sure. I will just have to break it down into seperate if statements till I can come up with a fix or some money to pay you people to do it. Link to comment https://forums.phpfreaks.com/topic/40804-small-issue-with-elseif/#findComment-197580 Share on other sites More sharing options...
btherl Posted March 2, 2007 Share Posted March 2, 2007 Give us some more details and we can fix it. First, tell us what you want the statement to do Then give us a printout of all the variables involved (using var_dump() if possible), just before the if statement. Then we can tell you why it's not working. Link to comment https://forums.phpfreaks.com/topic/40804-small-issue-with-elseif/#findComment-197593 Share on other sites More sharing options...
floppydrivez Posted March 2, 2007 Author Share Posted March 2, 2007 Ok lets have a good laugh on floppy's behalf. It was my dumb date("m") I was doing it all wrong. Thanks for the help. I obviously need a breather. I will post the corrections in a few mins. Link to comment https://forums.phpfreaks.com/topic/40804-small-issue-with-elseif/#findComment-197598 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.