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.





Add Data To A Database Using Dropdown Menus?


lets say i had a database with a table called admin hacks and another table called user hacks,and both tables had feilds called name and id

now what i want to be able to do is create a submit form with a drop down menu saying the table names mentiond above, also the form will have a field called name.

now lets say a user slected admin hacks from the drop down menu and enterd jack in the name, how would i get the data in that submitted form to be inserted into the correct database table, so jack should now be in the table called admin hacks

also lets say someone selected user hacks and entered jon how would i do the same for that?




View Complete Forum Thread with Replies

Related Forum Messages:
PHP Dynamic Drop Down Menus, Page Displays Diff Data Depending On Dropdown Selected.
I currently have two drop down menus the first one with countries and then the second one changes depending on which country is selected to display counties.

This works fine, now what I want to do is have it so when it county is selected it shows all the squash clubs that are in that county below the drop downs. Code:

View Replies !
Add Some Data From Drop Down Menus Into A Database.
I need to add some data from drop down menus into a database. The form loops on itself to add the data. I'm not sure which part I need to add the dollar too, i.e. the select name or the values in the list, in order to make it work. I've included part of the code below:

PHP Code:

$form.="Cateory 1*: <select name="cat"> ";
    $form.="<option value="Action">Action</option> <option value="Comedy">Comedy</option>";
    $form.="<option value="Drama">Drama</option> <option value="Family">Family</option>";
    $form.="<option value="Horror">Horror</option> <option value="Misc">Misc</option>";
    $form.="</select>

View Replies !
Dropdown Menus
i would like a Dropdown menu ordered by the parent cat and then showing its sub cats like below:

<SELECT>
<option value=0>Cat Name</option>
<option value=?>-Sub Cat</option>
<option value=?>-Sub Cat</option>
<option value=?>-Sub Cat</option>
<option value=0>Cat Name</option>
<option value=?>-Sub Cat</option>
<option value=?>-Sub Cat</option>
<option value=?>-Sub Cat</option>
</SELECT>

View Replies !
Dropdown Menus Problem
I have two drop down menus in my php script. The items displayed in the second is dependent on which item is choosen from the first i.e. the choosen item from the first filters the items in the second Code:

View Replies !
How Can I Create A Page With A Search Box Or Dropdown Menus
I have a database that contains houses, price, discription and photo etc. How can I create a page with a search box or dropdown menus that will look at the database and return what I have asked for in the search box or dropdown menus? I know this is a big ask, so a special thanks to anyone who can lead me in the right direction. The table consist of columns which are: house_id, address, ref, high_lights, more_info, pics_thumbURL, and pics_mainURL.

View Replies !
Getting Data From Drop Down Menus
I have a drop down menu and I'm trying to find out which option they have pressed.  I need to use the $_POST method to do this. Below is what i've written so far, but it's showing every time the messages:

"You don't have enough points"    AND   "you gained blah blah exp" I've blocked out some of the stuff that calls up files and stuff, just for security reasons Code:

View Replies !
Database Driven Menus
Im looking to pick the brain of someone with experience in creating menus that dynamicly alter depending on the content of a database which the site uses. I havent tried anything like this before so advice on technologies, techniques and common pit falls would be greatly aprishiated as would any scripts that i could adapt to use which would give me a good idea how everything fits together.

i need a menu that displays a number of catagoires (dependant on the number of catagories in the database) and then a number of sub catagoies also if the color scheme could be easily adapted that would be ideal.

View Replies !
Retrive Data From Pull Down Menus
Here is the code that I got to pull two separte lists from a SQL DataBase. Code:

View Replies !
Connecting Two Database Populated Select Menus
I am able to grab the data from the database to populate the menus individually using.
PHP Code:

View Replies !
Calling Dropdown Data From Db
I want to call data from the db and display it in a dropdown and make the selected option match the value of the record called. It thats clear? Code:

View Replies !
Populating A Dropdown From A Database
I have put together a script that populates a dropdown menu from a database. My database contains a table called casinocredit, and it contains records that have been enterend over 2 different months (may and june). There is a field in the database that contains the date in this format: 2006-05-12 00:00:00

So The drop down is currently showing a month for each of those records. I was hoping that it would only display one. (the plan is when a user selects a month (say May) and hits submit, then I would display all of Mays records on a different page) See the image i have attached for a view of what is happening. Code:

View Replies !
Autopopulate Dropdown List From Database
An events-registration page with a form containing a dropdown list for upcoming events, the events will be pulled from a table which is updated by...?

what i've gathered so far is that this can be done with PHP. I am a little unclear on the concept of how this is done. How does the updated information get input into the table?

1) can this be done (updating database) through a web interface by the client, or is it something i would have to do locally and then upload. If done by the client, can he delete/edit existing information--assuming he is not familiar with code.

2) what other things aside from html(good), sql(so-so), and php(newb) will i have to know?

i've seen a lot of good tutorials here and will have access to the necessary software. I just want to know if there is anything else i should know before i dive in head first without testing the PHP water, which i assume is frigid.

View Replies !
Selected Value In Dropdown Dependent On Database Value
i need a way to make the selected value of a drop down dependend on a result from a database query. PHP Code:

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 !
Insert Date To Database Using Dropdown Boxes
I be able to insert the date into my database if i have 3 dropdown boxes wherein it contain the month,day & year. i know the basic of inserting data into my database but with this 3 dropdown box i don't have any idea. after submitting, the data selected on these 3 boxes shall be in one field in my database with fieldname Date.

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 !
Data Entry Form With Dynamic Dropdown Boxes
I am working on a Form for user to register & enter their info such as name, email, address, tel etc. and I put in a couple of dropdown boxes namely country and city where user can select. I made them dynamic, i.e. the city dropdown is based on the selected value from country and the data retrieved from MySQL database.

The problem I have is the Javascript script involved a reload of the form and once I select a value from Country, the city dropdown populated with data OK but the data entered beforehand (Name, email, etc.) disappeared.

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 !
Retrieve A Data From My MySQL Database Using PHP And Save The Data In A Variable
How can I retrieve a data from my mySQL database using PHP and save the data in a variable in in my PHP code for example i have this table in the database

First name           Last Name
   Juan                  Punkista

I would like to store 'Juan' in variable $first and 'Punkista' in variable $last.

View Replies !
Is It Data From The TEST Or From PROD And Will It Be Data From Database1 Or From Database 2?
<?php

I have a question about 2 connection strings to a ms sql database.

# TEST DATABASE

$connecttest = MSSQL_CONNECT("TEST", "sa", "123456") or exit("Unable to
connect to MS SQL Server at 10.0.10.58");

$select = mssql_select_db ("database1",$connecttest) or exit("Unable to
select database TEST");

# PRODUCTION DATABASE

$connectprod = MSSQL_CONNECT("PROD", "sa", "654321") or exit("Unable to
connect to database at 10.0.10.59");

$select = mssql_select_db ("database2",$connectprod) or exit("Unable to
select database PROD");

$SQL = "SELECT * FROM table1";

$RESULT = mssql_query($SQL);

// What data will i find here? Is it data from the TEST or from PROD and
will it be data from database1 or from database 2?

?>

View Replies !
Using MS Access To Hold The Data And PHP To Collect The Data From The Database
I am using MS Access to hold the data and PHP to collect the data from the database and display it on a website. I've got the results displaying in the normal way with data being displayed in a linear manner e.g. Code:

View Replies !
Comparing Database Data And New Data
I am trying to create a PHP script that reads in a file, parses it for the data I want and compares it to the data I have in a database.

The data is points and ranking information for a Folding@Home Team.  Every week someone creates a news item with points gained by each team member for that week and other info.  This is done manually and takes a lot of time.  I hope for my script to automate as much of it as possible.

The script was to run as follows:

Download and parse latest statistics into 2D array
Compare usernames in array to usernames held in Database
Any new usernames and their respective points/rank to be added to database

Compare points in 2D array of each user to those held in database.
Output username and points gained

I thought I had a working script until I actually tested it on real data, and realised I missed something rather obvious - the order of usernames from the parsed file is not going to be the same order as in my database - due to people moving up and down the ranks.  So i can't just get a recordset from the db and run a simple loop to compare it to the parsed data.

I am not sure how to go about comparing the database information with the parsed data that works around the fact the data could be in any order.  The only thing i can think of is:

foreach item in $parsed_data_array
    query database for $parsed_data_array=>username
        if(number of results == 0)
          build new insert query for current username
        else
          continue

I don't know if this works [haven't tested yet] but I can't help feel it is a little DB intensive.  There could be up to 200 queries being sent to the database.  This can be minimized by adding extra criteria, like ignoring inactive users of course.  Is this a viable solution or is there a much better way of doing this?

View Replies !
Menus In Php
currently i have web application in php which has its menus created in
javascript.
if we do view source on the page, it displays all the javascript which
is obvious n natural.
but it displays all the file names of php too which are related with
those specific menus.
dont we have any way by which we can prevent it.
as an alternate i m thinking of creating the menus also in php so that
the names of my files dont get visible to the user from the security
point of view.
is it sensible to do so because it will be an extra overhead to the
system for creating the manus everytime.

View Replies !
Do Menus
what way is the best way to do menus and MULTIPLE layouts and languages in PHP?

View Replies !
Menus
I'm looking for a way to build a dynamic menu systems. I have a project that I have under way that will help you spec a computer system. I will be using drop down (select) menus, and I wanted to know if its possible that if you select one option that it would remove certain options from the next menu as they would be incompatable with what was selected above.

View Replies !
& Menus
Firstly I am a fairly recent newbie to PHP & MYSQL but I am catching on pretty well. I would like to use them to build a dynamic menu system for a catalog type website.

I have several 'category' names that can change. I would like to recall the category names from the database and use them to build a set of menu 'buttons'. When a button is pressed, I would like to assign & pass a variable (the category actually) back to another php script that searches the database for all items in that category and builds a display page.

I have most of it figured out except the part about how I can construct the menu so I assign & pass a different variable out of the menu when each button is pressed.

View Replies !
Drop-down Menus
How can I create drop-down menus in PHP?

View Replies !
Sticky Menus
It's common courtesy to ensure that a form with validation problems reposts with the fields still filled in, so the user doesn't have to start over, by echoing the variables in the Value attribute of the text fields, but I also want to have a drop-down menu to be sticky and retain its selected state when the page reposts.

View Replies !
PHP And Drop Down Menus
I've looked through the forum rather extensively and my qestion is similiar to the question by Brian_F and answer by "saintaw" a couple of days ago in this forum. I already have a functional page that has several dynamic drop-down menus from which the user selects a topic of interest.

My question is how to reference their choice from the drop down menus in order to display the results of their choice. I would like the user to be able to choose a subcategory with one of the drop down menus and then be able to view the questions related to that subcategory.

I currently have a nested for loop which displays the categories and subsequent drop-down menus for each category, and I'm using PHP and MySQL to do the dirty work. code:

View Replies !
Dynamic Menus
<?php
include('./common_db.inc');
$link_id = db_connect();
mysql_select_db("test_db");

?>

<form name=carform action=
<?php echo $_SERVER['PHP_SELF'];
?> method=post>
<?php


$query =mysql_query("select DISTINCT CQ_PROD_PLATFORM AS make_id from
CQ_data ORDER BY make_id");
echo '<select name=make
onchange="document.carform.submit()"'.">"."
";
if (!isset($make))
{
echo '<option value=null selected>Choose a Make</option>'."
";
}
while(list($make_id) = mysql_fetch_row($query))
{
echo '<option value='.$make_id;
if (isset($make)&& $make_id == $make)
{
echo " selected";
}
echo '>'."$make_id".'</option>'."
";
}
echo '</select>'."
";
echo '<select name=model
onchange="document.carform.submit()"'.">"."
";
if (!isset($make))
{
echo '<option value=null selected>Choose a Make First</option>'."
";
}
else
{
$result = mysql_query("select DISTINCT CQ_SUBSYSTEM AS name from
CQ_data where make_id='$make' ORDER BY NAME");
echo '<option value=null selected>Choose a Model</option>'."
";
while(list($model_id) = mysql_fetch_row($result))
{
echo '<option value=' . $model_id;
if ($model_id == $model)
{
echo " selected";
}
echo '>$model_id</option>'."
";
}
} echo '</select>'."
";
?>

View Replies !
Drop Down Menus
I am trying to build a database system to keep track of busdrivers and how much this company owes them. So what I have done is I have made 3 tables. One for the driver and info like name, address, city etc.

number 2 table with sales info etc. and the third = more slaes info. So what I am trying to figure out is how on lets say forms to be able to choose the driver and add sales info to it? So here are my tables: Code:

View Replies !
Dymanic Menus
I have products stored in a MySQL database with each product belonging to a category. That category may sit under one or more other categories. What I need to be able to do it produce the site navigation based on the different categories and their parent categories. So basically I need to be able to produce the following HTML dynamically based on the categories store in the database.

<ul>
<li>Category 1</li>
<li>Category 2</li>
<li>Sub Category 1</li>
<li>Sub Category 2</li>
<li>Sub Sub Category 1
<li>Category 3</li>
</ul>

How would you store the category information in the database and what would the PHP script look like to produce the navigation?

View Replies !
Nested Menus
In each of my .php web pages I include("menu.php") which contains a menu of links to my web site pages.

How can I modify this simple model (without using a database) in order to create a nested template?

Do I have to create a different menu.php file for each group of second level pages? Or can I accomplish a two level menu with a single menu.php file (and still without using a database)?

View Replies !
Drop Down Menus And PHP
I am making a simple email application in PHP, I am wanting it to have a drop down menu for the importance of the email. I have looked around on google and I do not seem to find anything.

View Replies !
How To Insert Data Into One Form ,the Form Include 2 Table Data In Database
i had create a form and i want to insert the data, but my form was include the data from 2 table , wat will be the query looked like, can somebody give me the example ? How to do it?

View Replies !
Selecting Using Pull Down Menus ??
Just wondering how do u create that "ALL" search in php. For example i created a simple pull down menu (category) that has 3 options where each option has an id no. So my select command is " select * from tablename where id = /"id/" and lets say option 1 will have id 1 and so on.

But what i got stuck in was creating an ALL search does n e one know how to do them ?

View Replies !
Dependent Select Menus
I would like to create a form in which a 2nd select box appears
depending on the value selected in the 1st select box. The values of
the 2nd select box will come from a database.

My question is how to create this in php? One way is to re-load the
page depending on what's chosen in the first box, or alternatively to
use frames or an iframe?

Is there another, better way that can dynamically change the initial
page?

View Replies !
Dynamic Drop-down Menus
I am developing an on-line booking system, and am designing a script which creates a booking "area". An area has the following fields:

Area Name
Day start time (the time of day bookings can begin e.g 9 AM)
Booking Time Slot (the length of time for each time slot e.g 30 mins)
Day Finish Time (the time of day bookings must finish e.g 6 PM)

What i require is a method for locking down the users input so that the finish time is a list that is created that is divisable by the number of minutes used for a booking time slot . e.g. if the start time is 9 am and each booking time slot is 30 minutes, then the user must select a finish time which is divisable by 30 i.e. either on the hour or half past.

I have looked at several methods for doing this but cannot decide what would be suitable.
Ideally I want the user to be able to select the start time from a dropdown (static html would do) the select a booking time slot (again a static html dropdown would surfice) and then a dynamic dropdown be created with a list of Day Finish Times.

My questions are these:

Is this the right way to go about doing this - are drop downs my best option? If so, is calculating the day end time list the best way to go? Would javascript be more suitable, rather than a php form?

View Replies !
Dynamic Pull Down Menus
I was wondering if a kind person off here could point me in the right direction.

I'm making a form on my website so users can request certain information, the thing is, the information they will be requesting will contained in pull down menus, with all the data for the pull down menus in a database. How would i go about changing one set of pull down menus depending on what is selected in a previous menu?

For example, say a user selects "Honda", the next menu would contain all the Honda models in our database, if the user selects something else, they're given more choice again.

View Replies !
Select Menus Query
I have created numerous select menus where the user can if they so wish select all or any one of them.

At the moment my code insists that they always select at least the subfund menu. How can I set it up so that they can select any one menu? Code:

View Replies !
Concatenate Drop Down Menus
We would lke to have two drop down boxes on a search page. for example one drop down will contain light bulb wattages( ie 40, 50, 60) and the other drop down will contain type of bulb ( round, oval, twisty etc.). These drop down boxes would be hard coded. no need to change them.

how would we concantenate the two drop down boxes. ie. if someone chooses "50" and "twisty" the result would be one field that would contain "50 twisty". how do we do this. Then we need to use this new field to search the database and extract all the prodcuts that meet the criteria.

View Replies !
Linking Drop Down Menus
I'm very new to the PHP world and I'm trying to create two Drop Down Menus that are linked. For example if the first drop down menu had all the States listed and the other drop down would show all the cities to choose from once a State was selected in first menu narrowing the list. Hope this makes sense and I hope the solution is simple at this point of my education level.

View Replies !
Self Populating Drop Down Menus
i am trying to do is the following: I have a MySQL database that (very simplified) has a schema like this 'Students(Name, id, Course)' I would like to have a form on a web site that has 2 linked drop down menus, one 'Please select id' and one 'Please select course'. When a user of the site selects there Id from the first drop down menu, i want the second drop down menu to populate itself with the courses held in the database for the given users Id. I would like the first drop down menu to be populated from the database with a query similar to 'SELECT id FROM students'.

View Replies !
Connectin Two Drop Down Menus
I want to create to drop down menus where the second one will display options according to the option selected in the first one.For example:

1st Drop down menu contains:
- Premiership
- Campionato
- Bundesliga
- La Liga

2nd Drop down menu should contain the teams of the championship selected fron the first drop down menu. Any ideas?

View Replies !
Default Value For Form Menus
I'm building a page that has three list/menu form objects that all should be the same (allowing the user to select 3 options from the same list). Since the values of the menus are the same and come from my MySQL database,

I needed to reset mysql_fetch_assoc with mysql_data_seek so fetch would start back at the beginning of the list... hope that's clear. The problem is that the first menu starts off with the first item in the list, but the next two start off with a blank space. Code:

View Replies !
Using PHP And MySQL To Populate (select) Menus
I am a newbie to php *gasp* and I am trying to make a <select> drop down menu, but I want the menus populated by information from a field in my database. There are a bunch of entries in the field MUD, that are identical......I would like the menu NOT to repeat identical names. EX... Each name only once, even though it is in the database many times.

View Replies !
Dynamic Menus And Blob Problems
I have a database table with three fields, id, caption and data. I
have used the id and caption to create a dynamic menu. it just throws
it into a loop with extra html formatting stuff. No problem.

The data field is a large blob. The data is a complete html file which
comes out of a timing system for race cars, its basically a big table.

How do I render the blob data within the current window or in a new
window when the link is clicked, its got me stumped. I have used php
to bring the page together using include statements, header footer and
side_nav. the menu gets produced in side_nav.

View Replies !
Drop Down Menus And Form Processing
I select a client from the first drop down menu, then a list of events for that client is shown in the second drop down menu. I then want to select the event from the second drop down and automatically go to a form I built "editevent.php3" showing information echoed from mySQL for that event. I have started the code, but know it is not complete. Code:

View Replies !
Php And Drop Down Menus Or Using Java Script?
I have a question about PHP and drop down menus. Should I be using PHP for my drop down menus or should I be using java script? I have a whole contact form that is programmed in PHP, but I have never done a drop down menu with PHP, is this possible? If anyone knows of any great drop down menu tutorials in PHP.

View Replies !
Insert Date Using Drop Down Menus
I know how to insert a date by filling in a field but I don't know how to do it using a drop down menu. One menu being month, another the day and the last the year. Any code snipplets I can disect and play with or tutorials on this?

View Replies !
Drop Down Menus And Mysql Insertion
I'm looking to create drop down boxes for a user to select the date and then have it insert what they select for month, day, year, hour, minutes and insert it into mysql. It needs to be organized in a timestamp like so: 2007-02-28 21:06:40

I've created the drop down boxes and it works pretty well: Code:

View Replies !
Multi-level Drop Down Menus
I am building a search page. There are 5 drop downs from which the user can select search filters. However, some of the drop down list selections will invoke a sub-list.

I was hoping to use javascript only to invoke a refresh when the menu item was selected from the drop down, and then use php to re-build the form plus the sub-list drop down menu.

I can get javascript to refresh the page, but all other form fields are lost. I don't want the user to press "submit" to invoke a sub-list because a "submit" button implies that the search will begin, not that there will be more items to select.

View Replies !

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