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.





Dropdown Lists From A Mysql Db


Id like to load a drop down list from a mysql database using php3 and create a link to that record. Does anyone have any ideas?




View Complete Forum Thread with Replies

Related Forum Messages:
Dropdown Lists
I've been doing a site for a while now that has several drop down lists in a form. On one form there is the same drop down list repeated 3 times from the same table in a database but with different values. What would be the best way to repeat the code without repeating all of the code. Basically looking at an more economical way to do things. Would you do a while statement and loop through them or maybe a single array and call it when you need it. Any opions?

View Replies !
Dynamic Dropdown Lists
I am recoding a greeting card website.

I am using dropdowns as filters for items in a DB, so when the user picks "animals" from the "theme" dropdown, the returned cards all feature animals, and when the user picks "birthday" from the "message" option, the returned cards all feature birthday cards.

However, there are some combinations that don't return any results, for example "get well" "floral" cards. Code:

View Replies !
Classes And Dropdown Lists
The class below works fine. The problem I have is there's a dropdown list in the middle of the loop. The dropdown list gets its data from another table in the database. Which goes through the same class. So I have a loop within a loop.

What I'm trying to do is ....

View Replies !
Create State-cty Dropdown Lists
I've gotten everything up and running except for this -- I'd like to
be able to have people have a dropdown list of cities in the US to use
(or wherever) and not have to input them manually into a text field.
When you do then there are issues of misspellings, etc.

Now I have a list of cities from each state that is a sample that
works in an html page. Problem is that it takes up 2 MB! Way too much
to load on a single page and I was wondering how this is accomplished
best -- do people use javascripts that can pull information from
another flat flie? Do people use PHP to connect to a mysql database
that might have a list of these fields and then reloads the page?

I'm really not sure of best options and would be grateful for anyone
to give me pointers or whether there are other examples and even
places to buy these databases (not likely but good to have if I decide
to do so.)

View Replies !
Get Two Dropdown Lists Working On A Page
i am trying to get two dropdown lists working on a page. How do i go about this. For example, I have 1 table which holds countries and cities. When a user selects a country in the first dropdown list, i'd like the second dropdownlist populate with a list of cities etc. from my database.

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 !
MySQL Lists All The Results
I have this code which works well, it lists all the results. but in results_data i have team1 and team2 feilds. I want to add a code to this so that if either team1 or team are = to say $teamsetid then it will show the row but no others. How can this be done?
PHP Code:

$result = mysql_query ("select * from results_data where group_id = $latest_group_id and comp_run_id = $compid order by list_order");

View Replies !
Mysql Generated Lists
I have a page where I am populating a list from a mysql database table with a variable passed from a previous page. code snippet: PHP Code:

// set varibles
$company = ($_POST['cds_user_company']);
$pass = ($_POST['cds_passtext']);

// Query the database
$query_plist = "SELECT * FROM cds_projects WHERE cds_company - $company ORDER BY cds_proj_name DESC";
$result_plist = mysql_query ($query_plist) or die ("query_plist on project_list.php failed to run"); // Run the query.

echo '<table width="750" border="0" align="center" cellpadding="0" cellspacing="0">
    <tr>
        <td width="205" valign="top">'
echo '<br><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Select Project :</br></br>'
......

View Replies !
Pulling Options Lists From Mysql Tables
I've set up a form to load data into my db, but rather than hard code the options lists for three of the form fields, I'd like to pull that information from three lookup tables. This will allow whoever is inputting data to do a simple update for the three lookup tables, and speed enter the data into the form for the fourth (data) table without having to alter the code in the form.

Here's the wish list. The three lookup tables have a key field and a description field. I want to display the description field content for selection by the user in the form (for example, from EventClass table,

display "Single Pony" and return "1" to the CompClass field if Single Pony is selected
Display "Pair Pony" and return "2" to the CompClass field if Pair Pony is selected
display "Single Horse" and return "3" to the CompClass field if Single Horse" is selected
(etc.)

in EventScores), and have the key field content loaded with the data into the data table. Once I've figured the coding for one, I can duplicate the effort for the other two tables.

I have seen PHP coding inserted inside php code. I've never seen this particular practice in any other language I've programmed in. Is this how a connect/query is handled inside a form which is inside a php script? <?PHP <form><?PHP ?> </form> ?> ??

To put it another way, I want to retrieve the data from a table and display it in the options box of the form. Then, when a option value is selected, I want the key for that value returned to the table in which data is being loaded.

View Replies !
MySQL Dropdown
Is there a way to make a dropdown by getting the options directly from the database? And I'm using this as a form so it has to have a name so I can call upon the value and do something to it.

Example to what I want to do:

- I have a database table named members and in that table, it has 3 columns - name, age, sex.

What I want to do is make a dropdown inside a <form> using the data from the database. And then when the person selects the name of the member and presses submit, it deletes the row with that name from the table and the database.

View Replies !
Dynamic Dropdown And Hardcode Dropdown In Select Form
I have plenty of examples of dynamic dropdown choices but none of hardcoded dropdown choices. The ultimate goal is to have a job with various tasks and to track the status of those tasks for a given job. I've used one of the tutorials here to begin the process. Below is the code I have to add work on a given task. Perhaps I actually need to "Update" a job as opposed to "add".

But the problem of the moment is I can't seem to hardcode one set of my options. This is the code I have: PHP Code:

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 !
MySQL, DropDown, PHP, Form!
Well I have this mysql database with some passwords. Now I have a form where a dropdown list is populated with the name of the users (there are repeated names).

Well what I'm trying to do is after selecting an user in the dropdown list, the post will be directed to a result form where I'll have again the name of the user and now his password (for that exact row). Code:

View Replies !
Mysql Dropdown List
Im trying to automatically fill a dropdown list with data from MYSQL table.

Sizes Table
--------

ProductId | size1 | size2 | size3 | size4 | size4 | size6 |

* the 'size' rows hold a numeric value for the quantity I have of each

I was hoping to only list the sizes that have a greater number than 0.
I have used an auto fill select code on another project but I'm just not sure how to fill in the blanks. Code:

View Replies !
Dropdown & Mysql-tables
I know how to create tables in mysql, thats no problem. I want to use a table with users-information; name, class, email, id and so forth. Then I would like a table with info about events; name, data...

What I want is this; when registered users come to the site they want to signup to these events and they want to select events via a dropdown-box. They chose an event and clicks a button and its stored in the db that they want to go to that particular event.

Now, in php and mysql, how is that done? I dont know how to setup the layout for the tables. And I think Im missing some in the php to.


View Replies !
Populating Dropdown With Mysql Entries
I would like to create a combobox in Flash which is populated with mysql data and programmed with php. For example: There are 3 entries in database .ie. apple, bannana, peach. Now these I want in combobox in Flash MX/flash5.

View Replies !
Mysql Php Display Column In Dropdown?
is it possible to show a column from mysql in a dropdown and then when that row is selected to display the information in an editable form ??

View Replies !
Dropdown Populated From Mysql Field
I'm looking to create a drop down box that displays a field from a a mysql DB so that i can list all the names and when I select a name from the list it selects that record.

View Replies !
Mysql Dropdown And Text Box Scenerio
I have on my web site a facilty where a user can change their trainer name. So 'bill' can change trainer from 'trainer1' to 'trainer4'. that kind of thing.

Currently bill would select the trainer from a dropdown menu where the menu is populated from a mysql statement of available trainers.

How would I create a facility where bill can either select the new trainer from the list or enter an entirely new one in a text box.

View Replies !
Dropdown List - Insert Into Mysql
I simply want to add a dropdown list where, when an option is selected, its value will be inserted into a dbase table. More specifically, asume there is a page where the user sees his order.

He will be able to select the order status (pending or delivered). So, for example, if his ordered is deleivered, by selecting "delivered" option, "delivered" will be inserted into the 'Status' column. Code:

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 !
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 !
Date Dropdown From Mysql Date Entries
For the PHP gurus out there, here is what I want to do: create a dropdown list of available dates from a mysql database date entries. But the dropdown/s should have 3 separate fields in month, day and year which in effect shows only those months, days and years that have corresponding entries from the database.

Planning to use this in the archive section of an online news publication so people can select issues to view via dropdown list that have corresponding entries only.

View Replies !
Mailing Lists
I have searched in many places about how to set up a mailing list that is scalable yet no web sites seems to want to give out this info. I need to have this mailing list be effective even up to hundreds of thousands of users. Any advice/resources on how to set up this mailing list?

View Replies !
Email Lists
How would I go about making email lists? Someone who has something similar to what I want told me that they handle it with PHP. I'm not talking about a form where I can email an entire list, but rather an email GROUP, such that any time email went to URL from ANYONE that is a member of my site, it would come into domainname.com, and then sent back out to everyone in the "group".

Any info would be helpful. Is this possible with php? What is the email process? Right now I'm not even on a domain name on my own server.

View Replies !
Ordering Lists
I have developed a script (with help) that tries to order events stored in my .txt file by date. The .txt file looks like this: 1st|Jan|Meeting at House| 15th|Feb|Meeting at your House etc

The script orders the dates from lowest to highest but does not order dates before the 10th. Apparently 1st - 9th comes after 31st.. Code:

View Replies !
PHP And Drop-down Lists
I want a simple HTML drop-down list like this:

<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". How would I go about doing that?

View Replies !
Drop Down Lists
I have used Php to generate a drop down but becos the action of the form is it itself ($_SERVER) I need to echo the value upon submission. Becos this is php generated I'm having problems. This is what the current code looks like:

[PHP]
echo "<select name="branch">
<option value="$variable">$variable</option>
</select>";

View Replies !
Maintaining Mailing Lists
I've few doubts; I'm asking two problem here.

1st, can we use PHP for maintaining mailing-lists. Say, we've 1000 users, need be e-mailed a subscription newsletter i.e. $message is same, loop through e-mail array in db.

2nd, Web site search. We maintain database after reading files using PHP and manipulate results from db.

Question is, if PHP is a solution for these problems, also, when users' ( 1 ), keywords' ( 2 ) dbs grow big! There is also a limit of a PHP script execution. In 1st case, PHP has to parse, suppose 10k subscribers, and generate 10k e-mail for sendmail program.

Is PHP feasible for such things. What else, is a better and professionally used solution. I don't know CGI? Perl?

View Replies !
Multiple Selection Lists?
i have a mutliple selection list on a form that goes like this

<select name='name' multiple size=6>";
echo "<option value='one'>one";
echo "<option value='two'>two";
echo "<option value='three'>three"; etc it works fine.

BUT how do u call it. For example say i selected option one and three. How do i call that on the next page so that ONE and THREE are stored.

View Replies !
Less-expensive Way To Set Up Defaults In Lists Etc?
I'm currently setting up default selections in <select> lists by
passing an array of those defaults as keys ( 'valuefoo' => true ) as
an argument to the function that sets up the list. Then, as I build
each <option>, I call array_key_exists ( thisoptionvalue,
arrayofdefaults ) to check whether to include the
'selected="selected"' string.

So the code looks something like

Routine ( array( 'valuefoo' => true, 'valuebar' => true ) ) ;
.....

function Routine ( $defaultvals )
{
for ( $i= etc. )
echo '<option....' . ( array_key_exists( 'curroptval',
$defaultvals ) ? 'selected="selected"' : '' ) . etc ' ;
}

(I've elided a lot of syntax, but you get the idea)

That seems slow and tedious. Does anyone know a cheaper way?

View Replies !
Quote's Invoices Lists...
I need someone to bounce some ideas off.

This is what I'm trying to do, I want to be able to create a script that
will spit out a quote based on the information filled in.

The part I'm stuck on is. Entering all the items in.

Ok, say I have a form, it starts off where you put in all the details
(eg, who the quote is for address phone no etc.)

Then there will be a list of items to go onto the quote.

Now this is the part I'm stuck on. I'm thinking maybe something like an
add new item button that opens a new window and then you enter in the
details for each item.
This then adds each item to the quote. Each item that is entered can be
added directly to the database. So what I'm thinking maybe is a popup
window that you fill in the details for each item, you hit submit, and
then it goes back to the origional quote page, but now with the item
added to the list.

Maybe is there java script where you can open a new window and then
refresh the parent window when the child is closed? this would then have
the items listed.

View Replies !
Mailing Lists Under Apache
I must develop mailing lists under Apache but I don't know how to do this, so, if someone knows how to do this.

View Replies !
Drop Down Lists And Variables
I have a dropdown list with values and I am having trouble getting the value chosen into a variable so that I can use it in an if statement.

View Replies !
Multiple Lists Selection
I am using a simple registration form that i made with the toolbox, but when I come to a multiple list to choose from (populated from the database) it doesn't work correctly. Of course, out of the multiple items selected only the last one gets inserted.

From what I have read, the selection must be turned into an array then looped for this to work. Is this correct? Next how would I code this to work right. If you let me know which code to post, I will post it.

View Replies !
Multiple Selection Lists &
I have 2 multiple selection lists. I am using javascript so that users can select items from list 1 and move them to list 2. When the user submits the form I need my php to get the values he has/she has in list 2...

I have done printf($_POST['list_2']) and it only shows one value, even when multiple are selected. I read that I need to change it's name to list_2[] but if I add the brackets to the name my javascript quits working.

View Replies !
Updating Lists On Page
The problem is that I am displaying all the rows of my table which have the value of the field 'approval' as 0. Now, there are to be 2 buttons next to each row with names "Approve" and "Disapprove".

If you click on approve, then the value of 'approval' for that row becomes 1 and if you click on "Disapprove" , the value of 'approval' becomes -1. How to accomplish it ? as the list being viewed will be changing very often. Code:

View Replies !
Populating Drop Down Lists
Could anyone help me on populating database driven drop down menus. I am trying to populate a second drop down list based on the selection of the first drop down list. I have the first drop down list running. Not sure about getting the second now.

View Replies !
Making Lists Of Words
Say I save into a field of a mySql database something like "two, three, four, five, six" all within one field, and then save each individual value into a spot in an array. So my array would go somewhat like a[0]=two a[1]=three and so on. I know how to do this in Java, but not in PHP.

Similarly, is it legal so write
$string = five;
$string = $string + ',' + 'six'

View Replies !
Dynamic Unordered Lists
I have searched about for this one but havent quite found the low down i'm looking for but here goes.

I'm trying to dynamically populate an unordered list from an SQL database which will have upto 5 or 6 sub-selections per top level list item so.. it would do something like this: Code:

View Replies !
Dpendent Drop Down Lists
I'm making a system for outage reports, I have a field that refers to the outage type.
I want when choosing from the list, for example, POP, all fields hat doesn't refer to POP issues to disappear. I made a demo with a software PHPrunner 4.1 and you can check it out. exapmle: I choose DNS so all feilds refer to POP and other issues should disappear.

View Replies !
Tables - Lists All Thumbnails In A Row
On my site I have a php search engine. I have changed the code to add thumbnails but my problem is that it lists all thumbnails in a row with 9 of them. What I need is to have 3 rows and 3 columns.

View Replies !
Generating Combo Lists
Lets say I have an array:
$fruitarr = array("apple", "banana", "orange", "lemon", "lime", "strawberry");

And I need to generate a list of smoothies over a period of 8 weeks. Each week only two of the fruits can be used together at a time. So for example, the choices for week 1 would be: Code:

View Replies !
Drop Down Lists And Textfields
I've found this is a great place to learn, so hopefully such can happen with the following:
Basically, I'm trying to develop a world market for a text-based game wherein what is available is listed inside a drop-down list, followed by an input box where the user can enter the amount to purchase (up to the quantity amount available) and submit.

Likewise, I've got a drop-down list populated via a MySQL query.  Altogether, the page looks like this:

My question is, how does one associate the input box with the drop-down list, assuming it's possible (which I would assume)?  Currently, it displays correctly, however when one submits via the "Purcase Goods" button, nothing occurs.  I'm not quite sure how to integrate everything coherently; my knowledge is limited in the area of PHP/HTML integration, so any explanation would be kindly appreciated.

I know long streams of code are often unhelpful in pinpointing a problem (or problems), but in the interest of not excluding an element, here's the code of the file in question: ....

View Replies !
Putting Lists In Order
I have produced a noteboard style calendar where all events of a particular month are called and then number representing the date is shown and then the event after it. I'd like to know if possible the code which will order the numbers from the lowest to highest number.

<?php

function getevents($eventmonth){

 $file = file("data.txt"); 

 foreach($file as $key => $val){ 

  $data[$key] = explode("|", $val); 

  $day = $data[$key][0];
  $month = $data[$key][1];
........................

View Replies !
Keeping Selection Lists
I would like to create 2 single-select drop-down selection boxes on a page

box1 - select academic year from 2001, 2002 , 2003 etc

box2 - select semester from 1, 2, 3 etc

As a result course details for all courses that satisfy these selection values get displayed below the boxes. The boxes remain availabel on the page. The user should be able to re-set these boxes to different values to generate different results. The boxes remain visible on the page. Is this possible ?

View Replies !
Have 3 Lists <selectfunction In A Form.
I have a huge list of selectives in a database. What I want to do is
have 3 lists <selectfunction in a form. 1 list will have countrys, another
list will have citys.

When a country is selected, I want the list of citys to show that is in that
country, if there is no citys i want it to go straight to the 3rd list. Is
this possible in php? if so do you have any examples.

View Replies !
Allowing Edits Of Lists
I want to provide users a page where they can browse entries in a database 10 at a time, for example. I am doing this as a table, where each row is a database entry. I want to be able to give the user the ability to modify entries. By either clicking on a link or a button on each row, I want the user to be sent to another page to edit that entry.

View Replies !
Showing Lists By State
I need to pull out a large list of companies out of a database for display on the web. They are listed by state, and I can sort them by state, but I need to show the state name as a heading above each state's list.

View Replies !
Dependent Drop Down Lists
I am building a data entry form in php to insert new records into a mysql database. There are two drop down lists - one for the Botanical name and one for the Common name of each possible plant. I need to make the two lists codependent so that if a user chooses by Botanical name, the correct matching Common name will automatically be selected, and vice versa.

View Replies !
Session Info And Pull Down Lists
i have a html pull down list (<SELECT etc etc <OPTION VALUE .....) and
i have the particular value the user last chose it to be in a
$_SESSION['value']. How do i set the selected item of the list to this
one? I can just add it in as the selected item of the list but then it
appears twice.

View Replies !
If You're Good With Arrays And Lists, This One's For You
I'm using PHP 4.4.4. Let's say I have two scalars, $list1 and $list2.
Both are comma separated lists of ordered, unsigned, unique integers.
An example would be

$list1 = "2,26,345";
$list2 = "3,4,26,35,525";

I am wondering if there is a short way of determining if all the
numbers in $list1 occur in $list2.

View Replies !

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