Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    PHP


SuperbHosting.net have generously sponsored dedicated servers to ensure a reliable and scalable dedicated hosting solution for BigResource.com.





Query From Db, Add Values In Dropdown Menu


i wanted to query my db, and then add values to drop down menu, where when they select what they want in the dropdown, it will bring them to another page accounts.php where they will have more options.




View Complete Forum Thread with Replies

Related Forum Messages:
Values From DB Into A Dropdown Menu?
Here's my database which shows which type of cards have been issued to a football player in my database: Code:

View Replies !
[PEAR:QuickForm] Dynamically Change A Dropdown Menu According To Another Menu?
I've been using QuickForm for a few months now and I am now given a
new challenge:

I've got a search form with a dozen of dropdown menus, the first
dropdown menu being "Brand". If you select either Brand A, B, C, D...
Z, the second dropdown menu "Model" must be dynamically changed to
model AA, AB, AC, AD..., according to the models manufactured by the
brand selected in the first box.

I've seen that done on quite a few sites, but never found if QuickForm
had a quick & clean way of doing that.

View Replies !
Dropdown Menu
i seem to be having some problems on finding how this ajax drop down menu i seen at Anime-Eden.com.

it has a nice effect on how it appears. Now i am familar on how PLAIN drop down menu works, but not how this works.

View Replies !
Use A Dropdown Menu
I have a list of contacts which are sorted by name. I was hoping to create a dropdown menu in which someone can sort the list of contacts by office, city, state, and contact type. Is this possible? (I am sure it is, but I am not sure what the concept is called so I may research how to do it).

View Replies !
Advanced Dropdown Menu
I want to populate a dropdown menu with countries that are in one column of my table. I know how to do that, but I can't find how to eliminate multiple items. Some countries appear several times in different rows, but I only want each available country to be shown once in my dropdown list.

View Replies !
Mysql / Dropdown Menu
what i am trying to do is to make a system with a few input pages and edit and read pages..

so right now i got the input/edit/read pages working. (yay) But now I want to have on 1 input page a dropdown menu that reads its information from the database. and that if i go to the page i can select a value out of the db and submit that inside my form and that it reminds the value if i view or edit the page.

So what i got now is a little system that is able to add/remove/edit a value inside a field called "drop01"

Well now i got a other input page called "input01.php" inside this script i want to have the dropdown menu that reads its values from the "drop01" field. PHP Code:

View Replies !
Autoselecting A Value In A Dropdown Menu
I'm revamping my sites administration panel and I put in a dropdown menu to select the section to administrate (it was a LOT better than the list of links I had before, I'll probably update it some more though) and I want to know how I can autoselect whatever page I'm on in the dropdown menu, for example, here's the menu: Code:

View Replies !
Multiple Dropdown Menu
i attemp to design a drop down menu that call up data from a table for each drop down menu. Code:

View Replies !
Dynamic Dropdown Menu
with help from the PHP Gurus here, I have a dynamic menu script:

PHP Code:

<?php
$time = time() + 28800;
$time_plus2 = strtotime('+ 6 days');

echo '<select name="select">'
while ($time <= $time_plus2)
{
    echo '<option value=>' . date('l, F d', $time) . '</option>'
    $time = strtotime(date('Y-m-d', $time) . ' + 1 day');
}
echo '</select>'
?>

how do I now get the days of the week to link to different pages?

View Replies !
Assigning A Dropdown Menu
how i can assign a drop down menu value to a session variable.

View Replies !
Populating Dropdown Menu From Db
Okay, I am trying to populate a drop down menu with items from a table in my db. I have a table called "teacher" which has the following info: I use the following code to grab the info from the teacher table. Code:

View Replies !
Dropdown Menu Updates
I have seen this on lot of sites, where say you goto a car site, and you click the make of the car from a drop down menu, and than after u click it, it will load up the appropriate models for that make.

View Replies !
2 Questions. Dropdown Menu And # Of Rows.
1. I have a table named pics and a column named name, just to let you know for use. I want to take the data from each row in the name column and insert it into a dropdown menu.

I know how I could do it, but I would have to go:

Code:
<SELECT NAME="name" SIZE="1">
<OPTION SELECTED><?php $name[10 ?>
<OPTION><?php $name[1] ?>
<OPTION><?php $name[2] ?>
<OPTION><?php $name[3] ?>
<OPTION><?php $name[4] ?>
<OPTION><?php $name[5] ?>
<OPTION><?php $name[6] ?>
</SELECT>
but then I could make too many or too less. I want it to automatically adjust to the number of rows.

2.What is the code needed to find out how many rows are in a table?

View Replies !
Dropdown Menu Without Submit Button
How do I get a dropdown menu to submit with the selection of an option rather than pushing the submit button.?

View Replies !
Searching Database With Two Dropdown Menu
I have searched the whole forum for the script. Please let me know if there is any script .

View Replies !
Unwanted URLs In URL Dropdown Menu
I'm working on a PHP script and it has a user login, and the variables (username, password, id number) are passed via the URL bar. Is it possible to somehow not allow the visited page show up in the dropdown list of URLs in the browser? The problem is that people can view the list and easily see people's usernames and passwords. Example:

http://www.somesite.com?username=john&password=12345 What I only want is:
http://www.somesite.com/

I know that Hotmail.com doesn't show all of the pages that have been visited, all it shows in the list is hotmail.com, so I think it is possible to do this, but I don't know how.

View Replies !
Make A Dropdown-menu Filter?
I have a dropdown menu which is supposed to filter a table to show results for professionals, students or all. But I don't really know what I'm doing.  This is what I have so far. Code:

Initially, I was able to filter for students or professionals, but since trying to have an all option (students and professionals) it has gone to pot, and I keep getting errors.  I know that my quotation marks are not right, but I can't think of a solution. I would be more than happy to see any ideas, even if they are completely different to mine!

View Replies !
Dropdown Menu <selected Name="...
I have a dropdown menu like this one:

<select name="country" tabindex="6" id="select_country">
<option value="">- Country List -</option>
<?php 
$query = "SELECT * FROM country ORDER BY country ASC";
$result = mysql_query($query) or die('Error, query failed');
while ($row = mysql_fetch_array ($result)) {
$country = $row['country']; ?>
<option value="<?php echo $country ?>"><?php echo $country ?></option>

After I have selected one country and I hit the submit button it go back to the default value in the box, what I want is to show the selected value in box until I selected another value.

If the default value is Australia when I start this page, I then select USA and hit the submit button it reset to the default value "Australia", but I want it to show USA as long I not select anything else. I have tried to use session in selected="<?php echo $_SESSION['country']; ?>" but it didnt work.

View Replies !
Trying To Create Dropdown Menu From List
I am trying to create a dynamic dropdown select menu from a directory containing other directories and files. This is to select a certain page from the list so I can edit it. I only want the files in the menu. Here's what I have so far but it doesn't populate the dropdown. Code:

View Replies !
Selecting Item In Dropdown Menu
Im having problems trying to select a specific option in the drop down menu which has been populated with a list pulled from the 'category' table in the db. The option that needs to be selected is pulled from an id in a 'item' table, relating to the aformentioned category table.

View Replies !
Dynamic Dropdown Menu Glitch
I wrote this code to dynamically generate an array from files on my server and put it into a drop down menu, but the code cannot be inserted on any page anywhere without it cancelling the loading of the rest of the page. Any ideas? Here is the code: PHP Code:

<? $the_array = Array();
$handle = opendir('walrus/strips/.');
while (false !== ($file = readdir($handle))) {
   if ($file != "." && $file != "..") {
$file = substr($file, 0, -4);
$the_array[] = $file;
   }
}
closedir($handle);
asort ($the_array);
reset ($the_array);.....


View Replies !
Network Bar, Dynamic, Dropdown Menu
Basically I have a "network bar" that I place on the top of all my sites, which has a dropdown menu box to interlink all my other sites. Basically I would like to really modify this idea out more. Code:

View Replies !
Tree View Dropdown Menu
I have such a categories MySQL table: ID | name | parent and have such a function that displays the categories in a SELECT element as a drop-down menu:

function DD_ProjectCategories($parent=0) {
include("db.php");
$query = "SELECT ID,name FROM categories";
$result = mysql_query($query) or die(mysql_error());
echo '<select name="parentcategory">'
echo '<option value="">Choose a parent category</option>'
echo '<option value="0">Root Category</option>'
while ($row = mysql_fetch_array($result)) {
echo "<option value="$row[0]""; if ($parent == $row[0]) {echo " selected"; } echo ">$row[1]</option>";
}
echo "</select>";
unset($query,$result,$row);
}.....

View Replies !
Change List View To Dropdown Menu
Im working on a script that has to be change so a user can choose from a dropdown menu instead of a list that now is displayed.
Here is the part that is insert on the index page.

View Replies !
How To Pass The Value Of Selected Dropdown Menu To Another File?
there is a php-myql script that list the mysql databases in the drop-down menu, use wil select one and the submit button should pass the value or variable $db_name to the test.php, this script list the databases in the drop-down menu but when i select one and then click on submit cannot pass the db_name to the test.php:

View Replies !
Stuck On Dropdown Menu List, Could Use Some Guidence
I have a form with some drop down list/menus. I do a check for ommissions and if found display a message to re-try. What I need is a way to show which options where chosen when the user submitted the form the first time.

If someone could show me how to do the first one, I'm sure it's the same process for the second one. Here's the code:

View Replies !
Duplicates In A Dropdown Menu Populated From My Database
I've been searching to figure out how not to have duplicates in a dropdown menu populated from my database. This is what I have, but how do I change it to get rid of duplicates.

<?php
$result = mysql_query("SELECT City FROM residential order by City");
echo "<select MULTIPLE NAME="City_code">";
while($row = mysql_fetch_array($result)){

echo "<option name="City" value="$row[City]">$row[City]</option>";

}
?>
</select>

View Replies !
Pagination And Dropdown Menu Used In Searching Mysql
I am working on building a database made for searching. I have a text search and a dropdown box used for searching different table collumns (lets people search for certan criteria). I have that working correctly.

I also only want to show 25 results per page. I have that working correctly. My problem is that when I combine the two it breaks the code. The pagination works fine without the dropdown and vice versa. I think it is due to the variable that is being used to choose the collumn in the sql query. Code:

View Replies !
Choose From A Dropdown Menu Of Encryption/decryption Cyphers
I've written a php page which allows users to type in a text string and a key, then choose from a dropdown menu of encryption/decryption cyphers, and a method (encrypt, decrypt). The whole thing works, except the mcrypt command doesn't work. here is my mcrypt command:

if ($method == 0) {
//Encrypt
$output = mcrypt_ecb ($algorithm, $key, $input, MCRYPT_ENCRYPT);
} else {
//Decrypt
$output = mcrypt_ecb ($algorithm, $key, $input, MCRYPT_DECRYPT);
}

Here's a list of what the variables may be:

$algorithm = MCRYPT_3DES
$key = "plain text"
$input = "more plain text"

View Replies !
Got The Dropdown Menu Populated From MySQL, But Not The Results After Submit
I have a dropdown menu populated from the MySQL database in a form. When I hit submit I want the results of the selection to be displayed. Code:

View Replies !
Get Dropdown Values
I am having trouble getting the values from a dropdown <SELECT>list and using the selected value as a part of my SQL statement. Code:

View Replies !
Retrieve Values In Dropdown Box
I would like to retrieve values in drop down box from database table. It should be the date value. The date is stored as 'yyyy-mm-dd'. I would like to retrieve , yyyy, mm, dd seperately in a drop down box. Ihow i can make it.

View Replies !
Pass Values Of Dropdown Boxes Into Variables.
I have a form I am creating, it has a total of three drop down boxes the first gets its info from the database the second is just static, and on the second drop down box I have added an on change event which calls a function, like this.

<select name="names" id="region" onchange="getregion()"

First question is, will that call a function in PHP? Second question is the function I need to write must have the values of the first and second text box, do you have to post this data to pass them into variables?


View Replies !
Auto Select Dropdown Lists From Db Values
I want a simple HTML drop-down list like this: Code:

<select name="select_1">
<option name="option_1" value="option_1" selected="true">
<option name="option_2" value="option_2" selected="false">
</select>

to be able to automatically select a value according to a value in a table in the database. For example, if a MySQL table has a field named "field_1", and one of the rows has a value of "option_1" in that field, I want the list (using PHP of course) to automatically select the option name "option_1".

View Replies !
Dropdown Box And A Query
Heres my situation:

In a form I want to read the categories listed in table $inv_table and present them in a dropdown window so the viewer can choose and add to a different table. The script below works with one glitch. There is a huge white space on the page above the dropdown box. This will get me by but it isn't too purty.

<td valign="bottom">
<a name="theform">
<select name="catname" size="1">
<?
{
$result = mysql_query("SELECT DISTINCT category FROM $inv_table ORDER by category",$db);
while ($myrow = mysql_fetch_array($result))
{
echo "<option>".$myrow["category"]."</option><br>";
}
}
?>
</SELECT>
</td>

View Replies !
Populating "Month" Dropdown Menu
I can get the current month to display in a text box by inserting
value="<? print strftime("%B"); ?>"> into the code for that
particular text box on a form but how can I populate a drop down with
names of all the months with the current one being 'default' as it
would be in the text box example?

View Replies !
Drop Down Menu Values
I have a form below that shows a dropdown menu. The values are email addresses populated by my SQL database, with their associated names placed between the option tags. (Don't ask why I'm using a SQL database - not my decision) My dilemma:

I need to insert the $ManagerName into another database, while at the same time emailing them. I DO NOT want to insert the email address into the database.

Currently it won't work because only the value is entered into the database, and not what is showing in the selection list. Code:

View Replies !
Add Values To A Drop Down Menu
I am trying to use this code to add values to a drop down menu. I can tell the variable is being passed to the correct document(PHP_SELF) however the value will not store into the mysql table. is my syntax incorrect?

I've read and copied and pasted several samples of scrips attempting the same task but they are causing parse errors. Code:

View Replies !
Values From A Drop Down Menu As An Array
I know i have passed the values from a drop-down menu as an array. I just cant recall or figure out how i did it. Does anyone know if its possible to do like this or something similar to get an array-

<select name="animals">
<option value="species, animal">animal</option>
</select>

View Replies !
Drop Down Menu Form Has Set Values
I am looking for any help with a form I am trying to make, one of the feilds I want it to be a drop down menu, so this part of the form has set values and nothing else. I have tried a few times too make this work, but I can never make it work, I can`t even seem to find help ojnline for this issue.

View Replies !
Population Select Menu Using Php And Database Values
I have no idea how to go about this. so i would apreciate some help i want to populate the values in a html select menu from database values in one table

so i want all the values from 1 particular field in the database to be displayed in the select menu as separate options.

View Replies !
Passing Values Using Drop Down Menu To Same Form.
how I am able to do this without the use of a "submit" button - ie onchange. Here is what I am working with.

<form name="form1" method="post" action="">
<select name="MyNumber">
<option value="One">One</option>
<option value="Two">Two</option>
<option value="Three">Three</option>
<option value="Four">Four</option>
<option value="Five">Five</option>
</select>
<input type="submit" name="Submit" value="Submit">
</form>

<?php @print ($MyNumber);?>

View Replies !
Pass Multiple Values In A Select Menu.
I need to pass multiple values in a select menu. How do I do this? How do I also pass SurName and FirstName? PHP Code:

echo '<select name="ffnumber" id="ffnumber"><option value="0">Select Name</option>'
while($row = mysql_fetch_array($result))
{
echo '<option value= "'.$row['FFNumber'].'">'.$row['SurName'].' '.$row['FirstName'].'</option>'
}

View Replies !
Ignoring Multiple Values In <select> Menu
I have some code that grabs urls from a table in my database, and then displays them in a drop down menu as a basic search criteria.....However, the nature of the table dictates that a url will be entered numerous times (as its a table that stores transaction details about specific urls).

My problem lies in that the code I'm using will display the url in the drop down menu 3 times (if three entries are in the database table).

What I would ideally like would be for the url to be displayed only once in the drop down menu, but have the script return results for all urls that match the selected one when the form is posted. Code:

View Replies !
Dynamic Menu Which Retains Values If Other Parts Of Form Are Incorrectly Submitted
I am try to create a dynamic pull-down menu which queries a MYSQL database for the states of Malaysia. I have been successful with this and the code is as follows: Code:

View Replies !
Query Using Drop Down Menu
can i query a table based on a drop down list?

i have a list of agents that i just want a simple drop down list to show the records they entered....

right now i just have the entire table showing all records in a html table format...but i want a drop down list so that if they only want to see the ones they entered, they can just select their name and poof...only theirs are shown...

View Replies !
Pull Down Menu Query
I'm trying to populate the pulldown menus of a single input form
through queries from a single table. The three columns are 'name',
'type', and 'status'. The name table runs to approx row 23, the type,
to row 8, and status, row 9. . I'm using the following code to
populate the form pulldown menus:: Code:

View Replies !
Drop Down Menu From Query Within Form
I want to add an extra field to hold a drop down menu from which the user can select the relevant information Code:

View Replies !
Select (drop Down) Menu Query
I have a MySql table (meat) storing the results data of on online culinary exam. One of the fields in the record is "optype". It is a drop down select field with about 12 choices.

I have a separate results page, and when a user goes to that URL the results are displayed automatically. I am currently displaying the results of the MySql table (meat) using the following query:: $query = "SELECT * FROM meat WHERE optype='Country_Club'ORDER BY time DESC"; Code:

View Replies !
SQL Query Selected From A Drop Down Menu
I've got the following query which gets values $search and $furn from a form.

SELECT * FROM properties WHERE description LIKE '%$search%' AND furniture='$furn' ORDER BY id ASC LIMIT $start, $display"

This works almost fine. The only problem is that because $furn value is either 'yes' or 'no', selected from a drop down menu, sometimes when is not selected the query doesn't work. Code:

View Replies !
Chain Menu But The Menu Should Be Multiple Select Menu/list
I am looking for codes to be able to do the same thing with multiple select menu/list.

PHP codes or javascripts codes are both fine.

1) javascript + php approach: Prefer to be javascripts codes to display the chain menu. I can use the php to get the all three levels menu data from the database, and assign these values to the javascript.

2) php codes only: Or use the pure php codes (the problem is if just using php codes then I have to submit the form to the server every time, when top level menu select changes to create new menu.).

View Replies !
Simple Menu, MySQL Query Question
I'm creating simple menu.

MySQL:

+----+-----+----------------------+
| id | sid | Title |
+----+-----+----------------------+
| 1 | 0 | Main Menu 1
| 2 | 0 | Main Menu 2
| 3 | 1 | SubMenu 1 of menu 1
| 4 | 1 | SubMenu 2 of menu 1
| 5 | 1 | SubMenu 3 of menu 1
| 6 | 2 | SubMenu 1 of menu 2
+----+-----+----------------------

What should be my query? I'm trying to select all titles, and display them:

Main Menu 1
- SubMenu 1 of menu 1
- SubMenu 2 of menu 1
- SubMenu 3 of menu 1
Main Menu 2
- SubMenu 1 of menu 2

View Replies !

Copyright © 2005-08 www.BigResource.com, All rights reserved