>It looks like I should be using is_null(), but I'm not sure how to use it, >especially since all of this is embedded in a print statement.
Disclaimer: is_null() is new-fangled, and while I assume it matches up with SQL NULL, it's *POSSIBLE* that PHP's NULL is for something entirely different than SQL NULL. Read the docs. >Instead of just printing Email: $row, I'd like to test whether it's null >first--maybe something like this? > >if (is_null($row)) print " " else print ("Email: $row") > >but can I put that line inside of another print statement? if so, do I have >to escape the quotation marks? Please forgive my confusion--I'm new to >programming in general and PHP in particular. Several options are available. In all cases, I've replaced the if/else with the trinary ? : operator. Less clunky. $email = is_null($row) ? 'NULL' : $email; # Didja know you could just hit TAB instead of that funky \t stuff? Way prettier, IMNSHO. print(" <tr><td>$email</td>..."); print(" <TR><TD>" . is_null($row) ? 'NULL' : $email . "</TD>"; #echo will take as many arguments as you like. echo "<TR><TD>", is_null($row) ? 'NULL' : $email, "</TD>..."; -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php