While empty() is convenient and may well be all you need to use here, I feel it necessary to point out that in certain situations it may not respond as needed, depending on your data and what you consider to be "empty":
<?php
$testData = array('space' => ' ', 'zero' => 0, 'zeroStr' => '0');
foreach($testData as $key => $val)
{
printf("<p>Value of empty() for '%s': %s</p>\n", $key, var_export(empty($val),1));
}
?>
Output:
Value of empty() for 'space': false
Value of empty() for 'zero': true
Value of empty() for 'zeroStr': true
If you only want to match on an empty string (and not any value of zero), then you should use:
if($row['name'] !== '') { // note the use of !== rather than !=
Or if you want to treat a value that is all white-space as also being 'empty':
if(trim($row['name']) !== '') { // note the use of !== rather than !=