Jump to content

Archived

This topic is now archived and is closed to further replies.

pixeltrace

help on dynamic pulldown menu

Recommended Posts

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!

Share this post


Link to post
Share on other sites
You are putting the select in the loop. It has to go outside your loop and just put in the info

[code]<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>[/code]

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

Ray

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.