Forum Moderators: coopster
The $baitlist[baitname] are being echo as $baitlist[baitname] and not the value. Which leads me to believe that my problem is with not using ' and " correctly. Can someone help me sort this out?
<?php $baitsql="SELECT baitname FROM baits WHERE memberid = '$_SESSION[MEMBERID]' ";
$baitresult = mysql_query ($baitsql);
echo '<select name="bait_name" id="bait_name">';
echo '<option'.($_SESSION['bait_name']==""? ' selected' : '').' value=""></option>';while($baitlist=mysql_fetch_array($baitresult)) {
echo '<option'.($_SESSION['bait_name']=="$baitlist[baitname]"? ' selected' : '').' value="$baitlist[baitname]">$baitlist[baitname]</option>';
}
echo '</select>';?>
Thanks,
Mike