searls03 Posted April 30, 2011 Share Posted April 30, 2011 how do I make this so that it is more of an & type of thing: if (isset($bs)){ echo $bs;} if(isset($ad)){ echo $ad; } else {echo "no events scheduled.";} I don't want it to check if there are any events scheduled with $bs, then it checks with $ad......and I don't want it to be an else if.....I need it to be more of check $ad and $bs, and if no results are returned for either it will display no events scheduled.....does that make sense? Link to comment https://forums.phpfreaks.com/topic/235206-ifs-and-else-ifs/ Share on other sites More sharing options...
fugix Posted April 30, 2011 Share Posted April 30, 2011 if (isset($bs) && isset($ad)) { echo $bs . "<br />"; echo $ad; }else { echo "no events scheduled."; } something like that maybe? Link to comment https://forums.phpfreaks.com/topic/235206-ifs-and-else-ifs/#findComment-1208712 Share on other sites More sharing options...
searls03 Posted April 30, 2011 Author Share Posted April 30, 2011 but && means it has to have both correct? I need it to be either one or the other or both....make sense? Link to comment https://forums.phpfreaks.com/topic/235206-ifs-and-else-ifs/#findComment-1208713 Share on other sites More sharing options...
samoht Posted April 30, 2011 Share Posted April 30, 2011 why not use OR?? if (condition1 || condition2) { } Link to comment https://forums.phpfreaks.com/topic/235206-ifs-and-else-ifs/#findComment-1208722 Share on other sites More sharing options...
u214 Posted April 30, 2011 Share Posted April 30, 2011 Use "||" Edit - Too late. Use the above way. Link to comment https://forums.phpfreaks.com/topic/235206-ifs-and-else-ifs/#findComment-1208723 Share on other sites More sharing options...
fugix Posted April 30, 2011 Share Posted April 30, 2011 yes then you would just change the && to || as stated above Link to comment https://forums.phpfreaks.com/topic/235206-ifs-and-else-ifs/#findComment-1208726 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.