PrMa Posted February 13, 2008 Share Posted February 13, 2008 Say I have 3 functions. How is the best way to code that? I have it like this now (example): If (function 1) { execute} If (function 2) { execute} else { execute} The problem is that only the else triggers. Clearly this method is wrong, so the question is; How should i code to make it work? Link to comment https://forums.phpfreaks.com/topic/90976-if-else/ Share on other sites More sharing options...
revraz Posted February 13, 2008 Share Posted February 13, 2008 What logic dictates which function you want to use? Link to comment https://forums.phpfreaks.com/topic/90976-if-else/#findComment-466263 Share on other sites More sharing options...
phpSensei Posted February 13, 2008 Share Posted February 13, 2008 Does the functions return a BOLEAN, STRING, or NUMBER? Link to comment https://forums.phpfreaks.com/topic/90976-if-else/#findComment-466266 Share on other sites More sharing options...
PrMa Posted February 13, 2008 Author Share Posted February 13, 2008 Nevermind, solved it myself, thanks anyway Just didn't use the else, instead one more digit to specify the third function, and leave the else out. And for the second qusetion, it returns a string from a database, in boolean mode. It's for a search function. Link to comment https://forums.phpfreaks.com/topic/90976-if-else/#findComment-466273 Share on other sites More sharing options...
aebstract Posted February 13, 2008 Share Posted February 13, 2008 None of what you said could have been answered in any way. You didn't tell us what you were trying to do. Link to comment https://forums.phpfreaks.com/topic/90976-if-else/#findComment-466296 Share on other sites More sharing options...
revraz Posted February 13, 2008 Share Posted February 13, 2008 And adding a 3rd option to two that don't work wouldn't solve it either, but glad you got it to work. Link to comment https://forums.phpfreaks.com/topic/90976-if-else/#findComment-466300 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.