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.





Produce A List Of Tables Currently Within My Database And List Them In A Drop Down Box.


I need to produce a list of tables currently within my database and list them in a drop down box.




View Complete Forum Thread with Replies
Sponsored Links:

Related Messages:
Working With Dates - Runs And Queries The Database To Produce A List Of Information
I have a script that runs and queries the database to produce a list of information, based on a date range. This is to fllow up on a script that is automatically run each Sunday night.

What I want to try and acheive is, for example, if someone manually runs this report on a Tuesday the script will assume that it is run on the Sunday night, to make sure the results are exactly the same as the emails that have gone out. PHP Code:

View Replies !   View Related
Database Into A Drop Down List
I'm trying to pull data from my database and display this data in a drop down list. I have 3 drop down menus, when a sourcre is selected in the first menu. only the destinations available from that source should be displayed in the 2nd drop down and then the destinations of the next selection displayed in the 3rd drop down.

View Replies !   View Related
2 Drop Down List Where Need Query Database
there is drop down list box linked to the database where it displays the state of a country and once the user clicks on the particular state, there purpose to be radio button displaying the locations available of that state, the location displayed in radio buttons are from the database. currently the source code i'm using is (which uses a submit button to query the database but i does not want the submit button it purpose to work using Code:

View Replies !   View Related
Displaying Data From Mysql Database In A Drop Down List On Form.
I'm trying to do is display data from two different mysql tables from the same database in a drop down list on a html form. I have a fixtures table with the player1(userid), player2(userid), gameid, game, score1 and 2, what I want is to use the userid to get the players first name and surname from the members table (as it is a unique id), I need to do this bit before displaying it in the drop down. I think i need 2 querys to do this but when I have tried it it just echo's a blank value or the userid not the forname and surname that I want. I'm using the fetch_array function but just can't see where I'm going wrong, Code:

View Replies !   View Related
How Do I Change The Drop Down List So The Option Selected Last Time Is Then The Current One Shown In The Drop Down Box?
I have a drop down list with the town options 'Bury' and 'Ipswich' as
shown below.

When selecting one of the options, its value is passed to variable
$townsearch.

How do I change the drop down list so the option selected last time is
then the current one shown in the drop down box?

<body>

<?php $townsearch = $_get['town']; ?>

<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="get">

<select size="1" name="town">

<option>ipswich</option>
<option>bury</option>
&nbsp;
</select>&nbsp;

<input type="submit" value="GO" />

</form>

View Replies !   View Related
Php And Drop Down List
I am coding an email form on a site. A user enters their name and contact email and then selects from a drop down list to which particular email the message should be sent: User1, User2, User3. Then the user types out a message and hits submit. My problem is that I am unsure as to how to grab the selection in the drop down list and pull the selection and place it like this: "$selection@domain.com". Here is the php code:

View Replies !   View Related
Drop Down Box To A List Box
i have this drop down box that displays the relevant info from the table that its loading. But the drop down box isn't quite so wise to use if there hundreds of rows. So what i wanted to do was change it to a list box instead ... would any one know how to do that? Code:

View Replies !   View Related
Drop-down List
I populate a drop-down list like this:

echo "<select>";
foreach ( $ip_list as $var )
{
echo "<option>";
echo $var;
echo "</option>";
}
echo "</select>";

Is it possible to have the selection in the drop-down list default to a particular value? For example, let's say the complete list of values looks like this:

65.162.31.155
210.213.149.6
68.190.20.83
130.202.234.254
68.122.35.157

When the page is loaded, I want 68.190.20.83 to appear as the selected value in the drop-down list. Can this be done? Any suggestions or examples welcome.

View Replies !   View Related
A Drop Down List
im just starting out with PHP and im making a website that hosts some images. Its going great so far but I want to have a drop down that can show my albums. such as:

          <form name="form" id="form">
            <select name="jumpMenu" class="dropdown" id="jumpMenu" onchange="MM_jumpMenu('parent',this,0)">
              <option value="#" selected="selected">Browse</option>
              <option value="#">Ground - Concrete</option>
              <option value="#">Grass</option>
              <option value="#">Metal</option>
              <option value="#">Graffiti</option>
            </select>
          </form>

I want the entrys for this to come from my images folder. For example if i have images/holiday then holiday will come up in the list. Is there anywhere I can get an example of this?

View Replies !   View Related
Drop Down List
PHP Code:

<?
         $query = "SELECT `teacher_id`, `teacher_name` FROM teachers ORDER BY `teacher_name`";
         if ($r = mysql_query ($query)) { // Run the query.

    // Retrieve and print every record.
              while ($row = mysql_fetch_array ($r)) {
                      echo "<select name="teacher">";
                    echo "<option value="{$row['teacher_id']}">'".{$row['teacher_name']}."'</option>";
                    echo "</select>";
              }

          }.....

View Replies !   View Related
$row In A Drop Down List
I have a query. where I loop through courses, I get the id for each course, pass it to the next page then, I want to query the database again with it, how do I do this.

<select name="course">
<?PHP
$query = "SELECT * FROM courses ORDER BY course_name";
$result = mysql_query($query);
while ($row = mysql_fetch_assoc($result)) {
  echo "<option id='".$row['id']."' >";
  echo $row['course_name'];
  echo ' ['.$row['course_date'].'] ' ; echo ' &pound'; echo $row['course_price']; // echo the number
  echo '</option>';
 }
?>
 </select>

Get the ID then pass it. how do I use it again on another page and another query.

View Replies !   View Related
Get The Filenames And Put Them In A Drop Down List.
I want to read a directory for available files and then get the filenames and put them in a drop down list. Whatever the user will select will be the value of the variable $selected. I already found the code to read directories: Code:

View Replies !   View Related
A Dynamic Drop Down List
I need to create a dynamic drop down list. By this i mean that the webpage html form = select style will recieve all the values as based on a query to a mysql database. I have no problems quering the data base with PHP, But i need to make some kind of for loop that will add a new value to the selct form for each result from the database. my thought process go like this.

1. call data base to guery. (no problem)

2. make variable variables that will be created according to the number of results (these variables must be created according to results of query, not a problem i think)

3. make a form like this

<form action = ***** method = post>
<select name = ******>
<option value = "This is a query result"> This is a query result> //This is the part i need to using a for loop and variable variables
</select></form>

so my problem is part 3, cause is this all done in PHP, or if i had all these variables, can i do this in HTML? Can i make a for loop in PHP that would break into HTML during these parts?

View Replies !   View Related
2 Drop Down List Using MYSQL
I have a model table with the following fields: MODEL_ID, MAKE_ID, NAME.
And a make table with the following fields:
MAKE_ID, NAME.

The first drop down list (make) to select a make of a car i.e. Chevrolet, Ford. When a make is selected, then all the model for that paticular make appear in the second drop down list.

View Replies !   View Related
PHP And MYSQL Drop Down List
I need a script to create a drop down list which has vehicle makes. The vehicle make list should feed a vehicle model list so when I select a make all the models for the make appear in the model list. I have a make table which has MAKE_ID, make NAME and a model table which has MODEL_ID, MAKE_ID and model NAME.

I tried using a script using javascript array but wherever I have a query that pulls the NAME from the database there's always a carriage return after the NAME which messes up the javascript array. I'd rather do it all with PHP if possible. If not please give me one that works and I don't have to spend hours troubleshooting.

View Replies !   View Related
Very Simple Drop-down List...
Hi! I'm having a problem with a very simple drop-down list since the
page comes out with no elements in the drop-down but giving no errors.
This is the code:

<form name="year_search_form" method="post" action="results.php">
<select name="select_year" id="select_year">
<?
$query="SELECT * FROM table ORDER BY year";
$result = mysql_query($query) or die ("Error in query: $query. "
..mysql_error());

while ($line = mysql_fetch_array($result)) {
print ("<OPTION value=".$line['year']."></OPTION>"); }
?>
</select>
</form>

View Replies !   View Related
Drop Down List From An Array
I want the array to contain a valid year of birth for anyone between the ages of 16 and 80. I'm pretty sure this code is correct.(though it might be a bit sloppy to all you pros) Code:

View Replies !   View Related
Drop Down List With Months
I am trying to create a drop down list that has December 2006 as the first option and then goes up month and years till the current month and year (September 2007).

View Replies !   View Related
Putting List Into Drop Down
I am working on a directory of businesses which has 8 main categories and each category has several sub-categories. Example: Dining is a Category with Pizza, Fast Food, Chinese, etc. I have the sub-categories brought up in just a list on the left side of the page and when the user clicks on a sub-category it takes them from client_list.php to client_filter.php only showing businesses in that sub-category of the main category. 

So only pizza places listed under dining.  However, I want to change the list to a (form) select box and then have the user click on the sub-category they want and then it takes them to the client_filter.php page to list only those bussinesses in that sub-categorie.  So after that long explanation how do I change my code to do that. Here is my current code:

View Replies !   View Related
Insert From An Drop-down List
i have a table in wich i've inserted city's name.then i have an registration form in wich  i want to display an dropdown list with the cities from the table, and if one city is selected to be automaticly added in the second table. how can i do that?

View Replies !   View Related
Custom Drop Down List
I am trying to get categories from the database and show them in a drop down list showing root category then their sub category underneath. Code:

View Replies !   View Related
Folder List Drop-Down
I am developing a PHP/MySQL project and as part of my initial setup and configuration scripts, the users can select a skin for the application, and a variable value ($skin) is updated to set the current skin, this works ok on it's own, but currently the user must manually type the skin name in a free-text box.

Ideally this needs to be a drop-down option box, and I would like this to be populated by listing the sub-folders within the '/skins' folder, so that it's always up to date. The folder structure looks like this:

/skins
/skins/skin1
/skins/skin2
/skins/skin3

How can I use PHP to generate a list of the current sub-directories in 'skins' and populate the drop-down list?

View Replies !   View Related
How Do You Pass A Value From A Drop Down List?
I am completely new to this. I don't understand how to receive a value from a drop down list <select> menu. I have read many tutorials and none of them explain the process of receiving the sent data.

View Replies !   View Related
Drop Down List Of Months
I am trying to create a drop down list with 12 months as the contents. I need to be able to determine what the latest month is and then put the 11 months before into it (in the correct order). For example, it is September 2007 obviously at the moment, so that will need to be the last and latest month in the list. The other 11 will be in reverse order going back to August 2006.

View Replies !   View Related
Populating A Drop Down List With Php
I am trying to get a drop down list to populate vbia php. What I have a is a script that allows a airline/user to enter airfare and price for tickets. It dumps them into a database and then allows the user to view/delete/add.

I want the user to be able to edit the airfare. I have a drop down list that is set as a variable $ticket_from, $ticket_to. The list contains around 400 cities. When the user clicks 'edit' I have the price population but no the drop down list. How do you go about something like that? I have this right now: Code:

View Replies !   View Related
Drop Down List Menu.
How do I make one item required on my "drop down" list menu? E.g., let's say that I want one state to be selected, how do I make this possible with PHP? My PHP skill is amature, but I do understand most.

View Replies !   View Related
Drop Down List Processing
I created a simple form in drop down list for USPS and FedEx. How do you process the drop down list?. If I select FedEx option, how do you retrieve it soI can use it in a query to find the Shipping Company store in my database. PHP Code:

<?php
   include ("header.php");
   print "Select shipping choice;
   
?>


<form action = "confirm.php" method = "post">                       
   <table border = 0>
    
      
       <tr>
      <td>Shipping choice </td>
         <select name="Shipper">

View Replies !   View Related
Dynamic Drop Down Box List - Php
I have two dropdown boxes. Two boxes have values from two different tables. They dont have any common field to relate with. I would like to display the values based on selecting the first combo box value. If i select first combo box value, then automaticlly the second drop down box value should be changed.

Code: ....

View Replies !   View Related
PHP To Display Drop Down List
I'd like to have 3 drop down lists connected.

Division
Department and
Section

Where the options of Department are dependent on what is selected in Division and the options of Section are dependent on what is selected in Department. So far, all the examples I've found have been using JavaScript. Can I do this in PHP as I have no knowledge of JavaScript at all.

View Replies !   View Related
Retaining Drop Down List Box Value
I currently have my drop down lists populated by a table from the sql database how can i retain the selected option once the form has been submitted. I know how to do this with textfields but cant figure out the dropdown lists because its being populated by a db. My code is as follows.

$cat = "<option value=>all</option>";
$cat .= "<option value=$row[id] $catselected>$row[name]</option>";

echo "<tr>
";
echo "<td class="classadd1"><div class="maininputleft">category</div></td>
";
echo "<td class="classadd2">
";
echo "<select name="in[catid]" style="width:200px;" onchange="changecat(this.options[this.selectedIndex].value)">$cat</select>";
echo "</td></tr>
";

View Replies !   View Related
Problem W/ Drop Down List
This current problem of mine is driving me nuts, there has to a solution. I'm farily new to PHP and have a couple questions which hopefully can be answered. I have two files, contact.php contains a form, with a drop down list.

When the user hits the submit button, they are directed toward tutorialcontact_result.php which catches any errors. If there is an error, on this page I provide a link back to contact.php. My first problem is: I'm trying to validate a drop down list using a regular expression as shown below: Code:

View Replies !   View Related
How To Add URL To Options In Drop Down List
I am have a drop down list, whose options are read in dynamically from a table in a MySQL database. one of the items being read in is an URL. I am unable to display this URL in the drop down list. The following is the code snippet I am using: Code:

View Replies !   View Related
Search Via Drop Down List
How would I go about writing code so that a user could search by a drop down list, clicking on the date they want and then the page shows the record with date,availability and price from the database?

View Replies !   View Related
Assistance With Drop Down List
I need some assistance with coding a drop down list Code:

View Replies !   View Related
Duplicate Drop-Down-List
I have a table with countries and their associate dailing codes in rows (about 240) and I'm outputting them to the page in a loop to be placed in a drop down list.

In my form, I am needing the list 2x so I figured, just copy and paste the same code in the other location. Problem is, the first location renders perfectly, the second doesn't render at all. I wondering if it has to do with the connections that MySQL can have at one time. Here's the code for the loop: Code:

View Replies !   View Related
Dynamic Drop Down List
I have poured over these and other forums, but can't find out what I'm doing wrong. I've found a few threads that deal with what I'm trying to do, but they didn't fix the problem.

What I'm trying to do is populate a drop down list based on info in my mysql database table. I have a game number id (game_ID) I want to use as the 'value', and the game name (game_name_long) that I want to use as the actual entry in the list box.

Here is the code I am using that takes the data from the db and populates the drop down list box: Code:

View Replies !   View Related
Drop Down List After A POST?
<SELECT name = "f_hello">
<OPTION value = 'H'>Hello</OPTION>"
<OPTION value = 'G'>Good-Bye</OPTION>"
</SELECT>

I can easily retrieve the f_hello variable which will containts H or G after a POST.

View Replies !   View Related
Chained Drop Down List Working Example
Could some PHP guru please help me? I looking for a good working
example of chained dropdown list.

View Replies !   View Related
Dynamic Drop-down List In Array
Q. How do I create a dynamically-generated drop-down list for use in
an array.

I'm using PHP with a MySQL database (through phpMyAdmin)

My database table is called com_courses, and I want to pull the
distinct 'title' fields and have them appear as a drop down menu for
the user to select in a form.

Here is my array, with (at the moment) manually-entered 'titles'
(which I now need to be dynamically generated from my database field:
'com_courses.title'

array (
"coursetitle",
"Course Title:",
$EXTRA_SELECTLIST,

array ("Report Writing", "Recruitment & Selection", "Presentation
Skills", "Essential Telephone Skills", "Time Managememt", "Customer
Care", "Other"),
0
),

I am not an experienced programmer, but can play around with php to
customize programs. I've read up on arrays (I bought a "Programming
with PHP and MySQL" book, but it just stops short of this problem). I
can't figure this one out.

View Replies !   View Related
Populating A Drop Down List With The Year
i'm trying to loop the years from 1960 - 2010 with the function get_year() below:
PHP Code:

View Replies !   View Related
Automatically Drop Down A List Of Phrases
I would like to know why when I go to a site like altavista.com and start to type in a phrase to search on does it automatically drop down a list of phrases that I have previously searched on, and how do I get rid of these from showing when I go to search.

I removed all of my cookies that were stored in my temporary internet folder. Is there somewhere else I should be looking. I am using IE 5.0 on a windows 98 machine.

View Replies !   View Related
How Do You Insert A Value From Drop Down List To SQL Table?
I am a bit new to PHP and SQL so this may seem like a dumb question.

I have already created a drop down list as part of a form which is
automatically populated with values taken from a separate database. When a
user goes onto this page and either leaves the default value or selects a
value from the drop down list and presses the submit button, I would like
that selected value to be stored into a database which I have already
created in SQL.

Just to let you know that I can do the above using a text field but just
don't know how to do it with drop down list.

If your going to explain any coding then it may help if I give you the names
of certain items that are involved.

Database is called "Company"
Field within database is called "Name"

View Replies !   View Related
PLEASE HELP - Drop Down List Related Question
I am creating a dynamic dropdown
list using a code snippet(Section A) as below:
Section A:
$sql_query=mysql_query("SELECT DISTINCT semester, year from
schoolproject_pics ORDER BY year
DESC");
echo "<select name="semester" onchange="GoTo()">";
echo "<option value="$semester">-Semester Year-</option>";
while($data = mysql_fetch_array($sql_query)){
if($data[semester]==@$semester && $data[year]==@$year){
echo "<option value
selected="$data[semester]">$data[semester]:$data[year]</option><BR>";
}
echo "<option
value="$data[semester]">$data[semester]:$data[year]</option>"; }
echo "</select>";
mysql_free_result($sql_query);

The 'GoTo()' Javascript re-draws the same page with the chosen values
of 'semester' and 'year' so that
the values can be recovered by $_HTTP_GET_VARS, stored in two hidden
variables and then used in
another query to create another dynamic drop-down list, as in code
snippet (Section B).

$semesternow=$HTTP_GET_VARS['semester'];
$yearnow=$HTTP_GET_VARS['year'];
if((isset($semesternow) and strlen($semesternow) 0) and
(isset($yearnow) and strlen($yearnow) 0)){
print("<input type="hidden" ID="semesterchosen"
value="$semesternow">");
print("<input type="hidden" ID="yearchosen"
value="$yearnow">");
$sql_query2=mysql_query("SELECT DISTINCT school from
schoolproject_pics
WHERE semester='$semesternow' AND
year='$yearnow'");
echo "<select name="school" onchange="GoMore()">";
echo "<option value="$school">-- School --</option>";
while(list($school) = mysql_fetch_array($sql_query2)){
echo "<option value="$school">$school</option>";
}
echo "</select>";
mysql_free_result($sql_query2);

Now the question:
When the page is re-drawn, how can the values of semester and year
previously chosen, be displayed in the first drop down list. I tried to
do it using the following, but it does not do anything:

f($data[semester]==@$semester && $data[year]==@$year){
echo "<option value
selected="$data[semester]">$data[semester]:$data[year]</option><BR>";
}

View Replies !   View Related
How To Display .txt Info Into Drop Down List
list out all the items from a file (data.txt) into drop down box for user to select.

Eg. inside (data.txt) has
Apple
Orange
Strawberry
etc...

How do I create a drop down list that can call out everything from data.txt (until end of file)??

View Replies !   View Related
Ordering A Drop-down Menu List
I am building a form that has a list/menu populating from the database. I'm using Dreamweaver to help code (which I know adds a mess), but I can usually edit it to do what I want. this is what it has:

<option value="<?php echo $row_rsPhysician['specialtyID']?>"<?php if (!(strcmp($row_rsPhysician['specialtyID'], $row_rsPhysician['specialtyID']))) {echo "SELECTED";} ?>><?php echo $row_rsPhysician['specialtyName']?></option>
<?php
} while ($row_rsPhysician = mysql_fetch_assoc($rsPhysician));
$rows = mysql_num_rows($rsPhysician);
if($rows > 0) {
mysql_data_seek($rsPhysician, 0);
$row_rsPhysician = mysql_fetch_assoc($rsPhysician);
}
?>

although if you have any generic code, I can play with it to get it to alphabetize my list. (the list is specialtyName and specialtyID is going into the database.

View Replies !   View Related
By Default My Drop Down List Starts With 31.
Why is it by default my drop down list starts with 31. How should i allow the loop to begin with 1?

Code:
$day = array (1=>"01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31");
$select = "<select name="day">";
foreach ($day as $key => $val)
{
$select .= " <option val="".$key.""";
if ($key)
{
$select .= " selected>".$val."";
}
else
{
$select .= ">".$val."";
}
}
$select .= "</select>";
echo $select;

View Replies !   View Related
Load Runner, Drop Down List
Can anyone send me the script for supplying the values in drop down list of the web page? I have couple of drop down list controls in my web page. I need to supply multiple values for each dropdown list in my script. How can i do that?

View Replies !   View Related
Drop Down List Box Using Data From MySQL
I've been trying to create a drop down list box using data from MySQL table. Mysql table is "ihs" and the field to be listed is "Bloom_Name", can someone tell me what's wrong with the code below and if possible tell me how to fix it.

<?PHP
mysql_connect("localhost", "xxx_xx", "xxxx") or die(mysql_error());
mysql_select_db("xxxx_xxx") or die(mysql_error());
$query="SELECT Bloom_Name FROM ihs";
$result = mysql_query ($query);
echo "<select name=ihs value=''>Bloom_Name</option>";
while($nt=mysql_fetch_array($result)){//Array or records stored in $nt
echo "<option value=$nt[id]>$nt[name]</option>";
/* Option values are added by looping through the array */
}
echo "</select>";// Closing of list box
?>

View Replies !   View Related
SQL Data Generated Drop Down List
This function works all the way to the while{} loop. It almost seems like there's no $result, but I've used the same script(-the dropdown list stuff) to generate search results and such....

View Replies !   View Related
Dynamically Generated Drop Down List
I have two tables - one named HOBBIE_TYPES, the other named MY_HOBBIES. The HOBBIE_TYPES table contains records listing a wide variety of different hobbies. This table is used with a PHP script to dynamically generate a drop down menu on a form that users can use to select and specify their favorite hobbies. Once they do so, their selection is added to the MY_HOBBIES table.

However, if a user decides to add more hobbies to their profile, I want the drop down list to exclude any hobbies that they have already added in the MY_HOBBIES table.

The code that I am using is as follows, and it is not doing what I want:

PHP Code: .....

View Replies !   View Related
Dates Fill Drop Down List
I have a drop down list and would like to fill it with 12 months starting from whatever the current month is:

EG: Current month is July 2005

I would like the list to show:

July 2005
August 2005

.
.
.
July 2006

View Replies !   View Related
Drop Down Box - Limit To List Property
This is really a html question but I'm posting it here because it's related to a php site I'm developing. I'd like to have a drop-down box (or 'combo box' as it's called in
visual basic) that allows the user to either select from the list *or* type in whatever other value they desire. In VB and VBA this is referred to as a Limit to List property.


View Replies !   View Related

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