Lots of different ways you can do this, but keeping it simple
// get your query results and include all the validation error trapping
// then process them in an associative array
while ($row = mysql_fetch_array($result)) {
foreach ($row as $key=>$val) {
if (!is_null($val)) echo $key . ' = ' . $val . '<br />';
}
}
Get each field, check it is not null then output it.
Sxooter, there is no mysql function to test for NULL like there is for pg.