Soldato
Another thing that might work simply as well, is to replace all instances of "<li>NULL</li>" in the HTML itself using your original query, thus leaving the good data in tact.
Another thing that might work simply as well, is to replace all instances of "<li>NULL</li>" in the HTML itself using your original query, thus leaving the good data in tact.
That error is due to a whitespace where it shouldn't be, probably after the <<<EOF.
$html = <<<EOF
<div class "{$class}">{$content}</div>
EOF;
visibleman, after some reading it appears the ? !empty :
Is a fancy way of doing an if statement.
If a value is not emtpy then execute the bit after ? else its false (colon) and output "" which outputs no html markup, therefore it doesn't show anything on my html page.
Is that it in very basic terms?
It's called a ternary operator or ternary if statement; essentially a shortened if statement -
( *condition* ) ? *condition true* : *condition false*
And yup, it'll work as you suggested and won't output that particular line/HTML if the table column field is empty (NULL).
However, is there a particular reason why you're using heredoc syntax for strings rather than the standard quotation in your examples?