Page 1 of 1

if and elseif problems

Posted: Fri Jun 16, 2006 3:44 pm
by snowrhythm
hallo...is there any reason why this shouldn't be working?

this->

Code: Select all

$partQuantities = array();

if ($_0NS1553 != NULL)
{
	$partQuantities["0NS1553"] = $_0NS1553;
}
	elseif (!$_0NS1553G == NULL)
	{
		$partQuantities["0NS1553G"] = $_0NS1553G;
	}
	elseif (!$_0NS1560G == NULL)
	{
		$partQuantities["0NS1560G"] = $_0NS1560G;
	}
	elseif (!$_0NS26721G == NULL)
	{
		$partQuantities["0NS26721G"] = $_0NS26721G;
	}
	elseif (!$_RB080440 == NULL)
	{
		$partQuantities["RB080440"] = $_RB080440;
	}
	elseif (!$_RB080880 == NULL)
	{
		$partQuantities["RB080880"] = $_RB080880;
	}
	elseif (!$_RB80888 == NULL)
	{
		$partQuantities["RB80888"] = $_RB80888;
	}
	elseif (!$_RBST0888D == NULL)
	{
		$partQuantities["RBST0888D"] = $_RBST0888D;
	}
	elseif (!$_RB080888 == NULL)
	{
		$partQuantities["RB080888"] = $_RB080888;
	}
	elseif (!$_RBST0888F == NULL)
	{
		$partQuantities["RBST0888F"] = $_RBST0888F;
	}
	elseif (!$_RB080440 == NULL)
	{
		$partQuantities["RB080440"] = $_RB080440;
	}
	elseif (!$_S0USRU606SL == NULL)
	{
		$partQuantities["S0USRU606SL"] = $_S0USRU606SL;
	}


print $partQuantities["RB80888"];
it's not printing out the array element. this code was actually a kind of test because a foreach statement i have later in the code isn't working and it had something to do with the array
not being full.

i hope i'm not posting too much on here...thanks for any help.

Posted: Fri Jun 16, 2006 3:52 pm
by snowrhythm
nevermind...i figured it out. really dumb mist ake (again). elseif doesn't happen unless if was false...i'm ready for the weekend.