Parse error: syntax error, unexpected T_VARIABLE, expecting ',' or ';' in
<p>I am trying to pull in a list box fr a table and match it to entries on another table for record editing.  I want the form to load the list box with the correct entry already selected in the list box.  Everything about the code works except the selection entry.  I know I am missing something, but I have been staring at it too long to see it.  Here is the code:</p>

<pre><code>&lt;?php
// Insert Listbox here
$query17 = "SELECT CODE, SOURCE FROM  APP_SOURCE ORDER BY SOURCE";
$list = mysqli_query($dbc, $query17);
if($list) 
{
   echo 'How did you hear about us? ';
   echo '&lt;select name="referred"&gt;';
   while($row = mysqli_fetch_assoc($list))
   {
      (($referred==$row['CODE']) ? $selected="selected" : $selected="");
      echo '&lt;option value="'$row['CODE'].' selected="'.$selected.'"&gt;$row['SOURCE']' ;
      // The error references the line above
     echo '&lt;/option&gt;';
   }
   echo '&lt;/select&gt;';
}
?&gt;
</code></pre>

<p>I am learning this on my own, and appreciate any help.  Thank you!</p>
