This is part of my script to print out everything into a table with two columns:
$lengthOfData = strlen($column[$i]);
// echo $lengthOfData;
if($lengthOfData == 0)
{
//there is normally an ampersand followed by a
//nbsp ; in the quotes underneath,
//but the forums took it as meaning
//a space directly, despite the code tags.
echo " ";
}
else
{
echo "$column[i]";
}
I'm trying to test whether the db table cell contains nothing. I.e. is null, in which case there needs to be a spacer put into the html table to make it display correctly. Otherwise the html table cell contains the data.
Sadly the if statement is not returning true, i.e. lengthOfData is not returning 0 even thought I've tested it, and it is.
Does this have something to do with the scope of the variable, is the lengthOfData available to the if statement?