I'm trying to format my output in one table cell so that a line break will be added only if a variable exists when pulling from a database. In other words, in the example below, if there is no data in the 'distaddress1' database table, I don't want a line break. If there is, then I do want the line break. Here is what I am using and this gives me a new line even if the variable does not exist (I've spent hours looking for a solution to this and nothing is working):
<?php echo $row_dealers['distaddress1'].'<br />'; ?>
<?php echo $row_dealers['distaddress2'].'<br />'; ?>
<?php echo $row_dealers['distcity']."," . $row_dealers['diststate'].",".$row_dealers['distzip'].'<br />'; ?>
<?php echo $row_dealers['distcountry'].'<br />'; ?>
<?php echo $row_dealers['distphone']; ?>