Jump to content

help on dynamic pulldown menu


pixeltrace

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!
Link to comment
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
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.