I want to have a dropdown from MySQL data where I want <option value ='and acode ='Aircraft1''>
, including the two single quotes to pass it into a query. I'm including backslash already but it's not working. What's wrong with my code?
<?php
$asql = "SELECT * FROM aircraft";
$aresult = mysql_query($asql);
?>
Aircraft:
<select name="aircraft">
<option value="and (acode = 'RP-C1086' or acode='RP-C1728')" checked/>All</option>
<?php while($arow=mysql_fetch_array($aresult))
{
echo "<option value='and acode=\'".$arow['reg']."\''>".$arow['reg']."</option>";
} ?>
</select>