I am retreiving a feild from a database, into $subcat. If $subcat is null, I want to show the form to add to a category, otherwise I want to display the category. $subcat definitly exists and is correctly retrieved. It is either null or a string.
if ($subcat != null) {
$showCategory = "<p><strong>Auction Category: </strong> ".$tmp['subcat'];
}
else
{
$showCategory = "<form name=\"categoryForm\">
<input name=\"radiobutton\" type=\"radio\" value=\"fakeapproved\" />Fake (Approved)<p>
<input name=\"radiobutton\" type=\"radio\" value=\"fakesuspected\" />Fake (Suspected)<p>
<input name=\"radiobutton\" type=\"radio\" value=\"keyword\" />Forbidden Keywords<p>
<input name=\"radiobutton\" type=\"radio\" value=\"parallelimport\" />Parallel Imports
<input name=\"Submit\" type=\"submit\" value=\"Update\" onclick=\"handleClick(".$pk.");return false\"/>
</form>";
}
However, all that is shown is the form. When $subcat is definitly, without a doubt not null, the form is still shown. I tried swapping the else clauses around, but then the category was displayed, even when $subcat was verifiably null.