Im tryin to fix when i press my search button. That the selected search from my option field remains selected. But at the moment it automaticly picks the first field of the options in my form.
First one is hardcoded and it works.
<option value="HS" <?= ($nickval == 'HS' ? 'selected="selected' : '')?>>Homer Simpsons</option>
But then i wanted to echo out option value from database so its not hardcoded.
<?php
while(db2_fetch_row($queryexe)) {
echo "<option value='$pin'>$fullname</option>";
}
?>
And now when i want to add if its selected i tried to solve it like this.
echo "<option value='$pin'($nickval == '$pin' ? 'selected='selected'' : '')>$fullname </option>";
This is how i get my pin
$pin = db2_result($queryexe, 'P510PIN');
This is how i get my $nickval
$nickval = $_GET["int"];
Any suggestions what im doin wrong? Sorry if im unclear but i've tried my best