I have this code and the problem i'm having with it is that once i select an option and save it won't remember the selection next time.but the post has been registered in the database with proper values. is there a syntax error that caught your attention? thanks for your help.
Platform : PHP,SQLite
<tr>
<?php
//location
?>
<td class='tdt' class='tdt'><?php te("Department");?>:</td>
<td>
<select id='locations' name='locations'>
<option value=''><?php te("Select");?></option>
<?php
foreach ($locations as $key=>$location ) {
$dbid=$location['id'];
$itype=$location['name'];
$s="";
if (($locations=="$dbid")) $s=" SELECTED ";
echo " <option $s value='$dbid'>$itype</option>\n";
}
?>
</select>
</td>
</tr>
<tr>