0

I am within my php code at the top of my page. This code is just after an sql database query and I am starting to layout my loop statement to build a search landing page on my site. I want to include an address within this but only if "Add1" is populated in the database, but I get an unexected if error when I run this code

I should say, this code is within an $htmlResult.= "Code from in here"

"if($row['Add1'] != ""){"
<h4>Address</h4>
<h5>" . $row['Add1'] . "</h5>
<h5>" . $row['Add2'] . "</h5>
<h5>" . $row['Add3'] . "</h5>
<h5>" . $row['Town'] . "</h5>
<h5>" . $row['Postcode'] . "</h5>
"}"

I thought you could do this, but I may be wrong

Even the ability to have this change to "No address found" would be helpful

Lewis Smith
  • 1,271
  • 1
  • 14
  • 39

0 Answers0