I have a database table which has all the projects listed in here with a column named "projCat" which is an ID field that relates to another table called projectcats.
The projects table projCat has an ID which relates to the projectscat ID.
<li class="field"><h2>Select Project Sector?</h2>
<select name="projCat" id="projCat" class="input">
<?php
$cat = $_GET['cat'];
$query1 = mysql_query("SELECT * FROM projectscat");
$checked == '$cat' ? 'selected' : '';
while($row1 = mysql_fetch_object($query1)){
echo "<option value=\"" . $row1->projCatID . "\"" . $checked . ">" . $row1->projCatTitle . "</option>
";
}
?>
</select></li>
The outcome I would like to have is a list of all the project categories but get the projCat so it highlights this category first.