Jump to content

how may else if's are you allowed to have?


nathanmaxsonadil

Recommended Posts

in some case like of your will be using a fix value to be conditioned like string or number

you can use the loop or switch like what akitchin said

 

something like

 

for($x=0;$x<=100;$x++)

{

  if($x==100) echo teng;

}

 

as you can see you dont have to have hundreds of lines to complete the test

Link to comment
Share on other sites

my code is like this

if($_SESSION['loggedin'] == true) {
if($variable == function($varible)) {
//do something
}else if(function($variable) !== "" && $varible == "true") {
//do somthing
}else if(isset($varible) && $varible == 1) {
//do somthing
if (mysql_num_rows($result) == 0) {
//do somthing
}else
//do somthing
}
}else if(isset($varible2) && $varible2 == '1') {
//do somthing
if(mysql_num_rows($result) == 1) {
do somthing
}else if(mysql_num_rows($result) == 0) {
//do somthing
}else {
//do somthing if logged in but nothing matches above
}
}else {
//do somthing if not logged in 
}

however this code just display's a blank page :(

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.