dsaba Posted February 26, 2007 Share Posted February 26, 2007 i read the control structure about if/else and switch statements but I didn't see anything about having multiple ifs or multiple cases basically what I want to do is IF this is true, IF this is also true, IF this is also true, and IF this too is true THEN this one thing is true i know how to make multiple thens on switch statements but not ifs can u make multiple ifs just like this? what is the proper syntax where can I learn more about this? sample if/else statement: if ($row['username'] == $svideosubmitter) ($row['username'] == $svideosubmitter) ($row['username'] == $svideosubmitter) ($row['username'] == $svideosubmitter) { $query1 = bla bla bla query; } code] sample switch statement: [code]switch ($s4transvideoifsubitles) { case "Yes" : case "Maybe" : case "Almost" : $transifsubtitles_he = "Ken"; break; } [/code] Link to comment https://forums.phpfreaks.com/topic/40213-solved-many-ifs-in-an-ifelse-statement/ Share on other sites More sharing options...
craygo Posted February 26, 2007 Share Posted February 26, 2007 if ($row['username'] == $svideosubmitter && $row['username'] == $svideosubmitter && $row['username'] == $svideosubmitter && $row['username'] == $svideosubmitter) { && = AND || = OR Ray Link to comment https://forums.phpfreaks.com/topic/40213-solved-many-ifs-in-an-ifelse-statement/#findComment-194563 Share on other sites More sharing options...
dsaba Posted February 26, 2007 Author Share Posted February 26, 2007 thanks ray i knew about the && syntax i didn't know if you could do it more than once though like more than 2 ifs in and if/else statement, i guess one time i tested it and it errored, from something else apparently as I now know it can be done thank you ray! Link to comment https://forums.phpfreaks.com/topic/40213-solved-many-ifs-in-an-ifelse-statement/#findComment-194573 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.