title: Check if SQL field contains data, if so echo data, else return text field
body: <p>I have a form that is filled out once a year per customer, but some fields stay constant (birthday for example). So my goal is when a new customer fills out the form for the first time the birthday field is a text box, but after they fill out the form the first time and come back next year it just displays their birthday but does not allow them to edit it (echo's the birthday, not simply shows it in the text box).</p>
  
  <p>What I have now is below, the goal of this statement is to check if there is a value in the SQL field, if so echo that value, else echo a text box. I keep getting an error when I try and load the form and I think its just a syntax error somewhere.</p>
  
  <pre><code>&lt;?php
  if($bday!="") //if bday field is not empty
  {
  echo $bday; //display bday field value
  }
  else
  {           
  echo '&lt;input type=text name=bday size=12 maxlength=12 value='&lt;?php echo htmlentities ($bday, ENT_QUOTES) ?&gt;'&gt;'; //else echo the text box
  }
  ?&gt;
  </code></pre>