Jump to content


Photo

help on dynamic pulldown menu


  • Please log in to reply
1 reply to this topic

#1 pixeltrace

pixeltrace
  • Members
  • PipPipPip
  • Advanced Member
  • 577 posts

Posted 06 March 2006 - 05:52 PM

guys,

kindly check
[a href=\"http://www.sinagtala.net/sinag3/submitfeedback.php\" target=\"_blank\"]http://www.sinagtala.net/sinag3/submitfeedback.php[/a]
i am having problems with fixing the pulldown menu in
the events title section. hope you could help me with it.

this is the script that i used for that section
==================
<?
include 'db_connect.php';

$uSql = "SELECT event_title FROM events ORDER by event_date DESC";
$uResult = mysql_query($uSql, $connection);
if(!$uResult){
echo 'no data found';
}
else{
while($uRow = mysql_fetch_row($uResult)){
?>
<select name="title" size="1" class="sorteventlist">
<option selected><?= $uRow[3]?></option>
<?
}
}
?>
</select>
==================
what's wrong with this?
thanks in advance!

#2 craygo

craygo
  • Staff Alumni
  • Advanced Member
  • 1,973 posts
  • LocationRhode Island

Posted 06 March 2006 - 06:32 PM

You are putting the select in the loop. It has to go outside your loop and just put in the info

<select name="title" size="1" class="sorteventlist">
<?
$uSql = "SELECT event_title FROM events ORDER by event_date DESC";
$uResult = mysql_query($uSql, $connection);
if(!$uResult){
echo 'no data found';
} else {
while($uRow = mysql_fetch_array($uResult)){
?>
<option value="<?=$uRow['event_title']?>" selected><?= $uRow['event_title]?></option>
<?
}
}
?>
</select>

I forget weather you need the value or not so I added it.

Ray




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users