I am struggling to get my syntax working for a dynamic drop down list
Here is what I have so far
<select name="companies">
<option value="-1" <?php if ($companies == -1) { ?>selected<?php } ?>>Select removal company to set prices of....</option>
<?php
while ($row = mysql_fetch_assoc($result)) {
echo '<option value="' . $row['id'] . '" if ($companies == $row['id']) { selected }> . $row['companyName'] . '</option>';
}
echo '</select>';
Any help much appreciated
Thanks
Paul