Creating Jump Menu With PHP
Posted: Wed Jan 17, 2007 1:59 am
feyd | Please use
The code will produce the proper jumpmenu that I want it to...however when you look at the source code when the page renders the "</select>" and all the code after it doesn't appear.
Not much good unless the jump menu is the last thing on the page...any clues as to what I'm doing wrong?
Thanks!
jnf
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
I am relatively new to PHP and I am having trouble implementing PHP code to create a "jump menu"...Code: Select all
<select name="menu1" onchange="MM_jumpMenu('parent',this,0)">
<? $db_host = "mysql"; $db_username = "user"; $db_password = "pass";
$db_name = "DATABASE"; $tbl_name = "TABLE";
mysql_connect ($db_host, $db_username, $db_password);
@mysql_select_db($db_name) or die ("Unable to select the database: $db_name");
$notstatus = 10;
$query = "SELECT * FROM $tbl_name WHERE Status!='$notstatus'";
$result = mysql_query($query);
$count = mysql_num_rows($result);
$i = 0;
while ($i < $count)
{
$qid = mysql_result($result, $i, "QID");
?>
<option value="FOLDER/FILE.php?qid=<? echo $qid; ?>"><? echo $qid; ?></option><br />
<?
$i++;
}
$mysql_close();
?>
</select>Not much good unless the jump menu is the last thing on the page...any clues as to what I'm doing wrong?
Thanks!
jnf
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]