Jump to content

empty fields


wilna

Recommended Posts

Hi

I have an address table, eg: memnr, name, adress1, adress2, adress3, postalcode, etc.  In some cases the member only has entries in say adress1 & 2, now if I display the information it looks something like this:

memnr = 1234

name = ABCD

address1 = Street 1234

address2 = City

address3 =

postalcode = 1234

 

I do not want to display the emtpy line in address 3, my code looks like this:

 

while ($row=mysql_fetch_assoc($result)) {

$memnr=$row['xnr'];

$namesurname=$row['surinit'];

$a1=$row['address1'];

$a2=$row['address2'];

$a3=$row['address3'];

$postalcode=$row['pocode'];

 

echo $memnr;

echo "<br>";

echo $namesurname;

echo "<br>";

echo $a1;

echo "<br>";

echo $a2;

echo "<br>";

echo $a3;

echo "<br>";

echo $postalcode;

}

Link to comment
https://forums.phpfreaks.com/topic/196360-empty-fields/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.