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.





Dynamic List Has Multiple Entries


On an input form there is a dynamic drop down list to select from a dozen different categories. The form inserts correctly into the database.

The problem is that every time a category is selected the drop down menu list it an additional time. For example if the list has: apples, pears, oranges. If pears is selected the drop down list will display: apples, pears, pears, oranges. Code:




View Complete Forum Thread with Replies

Related Forum Messages:
Multiple Entries In On Column/List Box
I'm creating a page where members can edit their research information. I'm going to have 12 List Boxes, each with about 20-25 words. I want the user to be able to choose as many as they need (by control+click) - and store them all in the database. I expect each member to only have about 4-5 .. but you never know.

The information they submit, all 4 or 5 or however many keywords, will need to be easily searchable on the main page. I also am going to need to make it easy for them to edit/update their keywords. My question is - which is the best way to do this? Do I dumb all the selected values into one column of a table? then when doing a search just do a text search?

And how do I implement the update page? I know how to show previous text in a text form field, but is there a way the options they chose can be pre-selected when they go to update their research?

View Replies !
Database Design For Multiple List Meny Entries
I have a database called nottsvcs with a design as follows:

refno (primary key)
organisation (char50)
telephone (char50
activities (list menu)**

My list menu of activities allows the user to pick more than one activity. My question is how do I change my db design to allow for storage more than one list menu selection?

View Replies !
Using Multiple Values From Dynamic Select List
I have a selection list which is dynamically populated from a SQL query. When the user makes their selection, the result is passed to the next page. Code:

View Replies !
List Last Entries On Database
I'm looking for a script that will list the last 20 entries from a mysql database, can anyone on the list help me ?


View Replies !
List The The Entries Of The Dropdown Box
How can I list the the entries of the dropdown box (which are all populated) according to the time they are populated.

View Replies !
Getting Multiple Entries
I am executing a query when someone searches on my website, I am saving the search terms to see what if anything is being searched for most of the time. I have this code on my search page

@include_once('/home/nsbsports/public_html/scripts/save_search.php'); //saves search terms

this is the code I am using to do the actual insert query with

require_once('connectdb.php');
$term = $_GET['aaa'];
$form = "d F Y";
$date = date($form);
$save = "INSERT INTO search_history (search_terms,date) VALUES ('$term','$date')";
$res = mysql_query($save);

when I look in my table the same search_terms have been saved 2 or 3 times for each query. Any ideas?

View Replies !
Multiple Blank Entries?
When I go to my secondary page of results after I fill info out on a form on
the first, I get 3 blank entries automatically inserted into the mysql
tables. This second form has these blank entries printing up each time even
if I go in to the second page w/o filling out any info on the first. Is
there a way I could prevent these blank entries from being automatically
entered? Like some code that says that if something is blank then not to
have it entered into the tables? or something easier?

View Replies !
Multiple Entries For Same User?
I am creating this form, and instead of having a huge list of input boxes for visitors to fill out, I am wondering if it is possible to have the user click on add another button, and a new submittion will be added to that persons file.

View Replies !
Select Multiple Entries
I attach a List Box Control, on a form. It has total five values i,e

a
b
c
d
e

I want that when my page loads, then entry no.2 (b), and entry no.3(c) are selected by default. How can i do this. give me the code.

View Replies !
Multiple MySQL Entries
I want to have two mysql entries in on variable

$sql = mysql_query("Query Here");

but I want to run two seperate queries at the same time for example, inserting info into two tables in the same variable.

View Replies !
Adding Multiple Entries
I currently have a form that adds data into a mysql database. What I would like to do is submit a duplicate entry as many times as specified in a "quantity" box. Pretty much I want the user to specify how many of the same record he would like to create.

View Replies !
Inserting Multiple Entries
I'm trying to built a page for referring uses to a web site, I've used a simple php loop to loop the input box for email address ten times, I've set the names as so:

name='Email<?=$i?>'

so that every name is different.

View Replies !
Use Checkboxes To Take Multiple Entries
I'm basically trying to create an email system which will allow my colleague to select jobs from a list using checkboxes which will then populate a textarea for formatting, then be sent out in an email. Not looking for too much code here, just a couple of snippets to point me in the right direction I can create the listof jobs and add checkboxes, I'm just not sure where to go from here. Having browsed the forums I'm guessing a foreach() loop would be called for, but I'm not sure how to get the multiple values from the checkboxes into an array, and from there how to put them in a variable to put into a textarea.

View Replies !
Preventing Multiple Database Entries.
I am trying to make my form processor detect if an item name submitted to the database already exists I would like to display a message saying the item is already in the db.

I tried something like this

if ($Item_Name == "$row["Item_Name"]") {

print "That item is already in the database";

}

Now I know this is wrong but if someone could point me in the right direction it....

View Replies !
Adding Multiple Entries With One Click
I've written a form in html and use php to process it to my database.  What I want to do is make it so that a person can choose a number and then by clicking submit it will create an amount of db entries that corresponds to the number that they chose. 

View Replies !
How To Delete Multiple Entries From Database?
I ran this script Im working on twice by accident which caused a ton of duplicate entries. I dont want to start over so how would I delete multiple entries in a database?

View Replies !
Logging Multiple Checkbox Entries
I was trying to make my software script be able to validate the checkout process of multiple software entries.

I also have it that when the admin validates the request to check out software that it will be logged in a seperate table. I can't seem to get it to work. When I look at the database software_logs table I'll see the entry is mostly "Array". Here's the code:

View Replies !
Parse Multiple Entries On A Page
I'm trying to parse multiple entries on a page, i've managed to get it working for the first entry, but can't seem to figure out a while statement that will run through all the entries on the page: Code:

View Replies !
Multiple Blank Record Entries?
I keep getting multiple blank records entered along with my data everytime
I submit my form.

On the first page is the form itself without any code. On the 2nd page that
it goes to after I hit submit is this: Code:

View Replies !
Multiple Entries In A Field Enquiry
I'm just after a little bit of guidance really. If I have a field in a table, is it possible to have more than one entry in that field and seperate them by either a , or a ; or something like that? For example:-

Field 1 - graham
Field 2 - david, bob, ian, nick, robin
Field 3 - simon

What I am aiming to do is have field 2 as a link through to a search page which searches on whatever name you click on so if you click on david it will bring up a search page listing all the pages with david in or if you click on bob it will bring up bobs pages.
Hope that makes sense, is it possible to do ?

View Replies !
Update Multiple Database Entries
I want to make a quick to-do list script. I can handle entering the info, etc.

What I have a question about is when I go and view the list of to-do items, once they are complete, I want to be able to mark them "Done"

So I'd have a list of all the items and a checkbox for each item. If 3 of 10 are done, I'd select the checkbox for those three, click the submit button and I'd like it to update one field for each entry.

So, I'd have todo_ID, todo_DONE and want to UPDATE todo_list SET todo_DONE = 1 WHERE todo_ID = '".mysql_real_escape_string($_POST['todo_ID'])."'

My question is how can I do this for multiple entries all at once?

View Replies !
Refreshing Page Making Multiple Entries
I have a form which accepts input from the user and then inserts data into mysql. The problem is, after user inputs data and a new page is loaded; if the user again presses "refresh" button, the same entries are re-entered into database.

View Replies !
Sorting DB Entries Over Multiple Pages (and Columns)
I am making an image gallery, and have previously had problems sorting the database entries over several columns, that is now sorted.

However, I don't know how to make the entries on page 2 to begin from image 10, page 3 to begin from image 19 etc (given that I am using a 3x3 table so 9 images per page. Here is the code that prints the URLs of the images (i am working with text, rather than IMG tags until it works): PHP Code:

View Replies !
Using Checkboxes To Update Multiple Database Entries
I have a query that shows a list of options that a user can toggle on
or off using a checkbox.

query...
form...
while($row = mysql_fetch_array($result))...
<input name="menu_show_attribute[]" type="checkbox"
class="checkbox"');
if ($row['menu_show_attribute'] == 1) {
echo (' value="'.$row[menu_id].'" checked />
} else {
echo (' value="'.$row[menu_id].'" />');
}

The list is generated from boolean values in a DB. This populates my
form with checkboxes, some are checked and others are not. I'm using
an if statement to sort it (checked). This works fine.

The problem is when the user un-checks a checkbox, the value does not
get passed and the DB does not update - set/change it to 0. The only
values that get passed are the checkboxes that are checked. Below is
the query / code after the submit button has been pressed. Are radio
buttons the answer? Any help / suggestions would be very much
appreciated.

//process form
for ($i = 0; $i < count($menu_show_attribute); $i++) {

if (isset($menu_id) == 'checked') {
$menu_show_attribute = 1;
} elseif ($menu_show_attribute != 'checked') {
$menu_show_attribute = 0;
}

$query = 'UPDATE menu SET menu_show_attribute = "'.
$menu_show_attribute.'" WHERE menu_id = "'.
$menu_show_attribute[$i].'"'
echo("<br>");
echo $query;
$result = mysql_query($query, $db) or die(mysql_error());
}

View Replies !
Populate MySQL With Multiple Text Box Entries
I have about 300 rows of mysql data which I have chosen to diplay with a text box at the end of each row, that is available for adding comments. I would like to be able to add comments to entries and then have an update scripte that would take the text box, named "MC" and place the data in its row identified by a hidden field which would corrrespond to the Primary Key of the MySQL Database. I've done something similar using check box arrays, ie. Checkbox name="MC[]"

My question is whether I can write a script that would test for a value in the corresponding text box, and update the MySQL data accordingly. I have also provided in my display script that if the MC column is already populated in MySQL it will not display in the form.

View Replies !
Checking For Multiple Entries In Exploded Array
Problem is this, trying to use multiple values from an exploded array to update rows.
Currently if there is more than one duplicate value in the array the update only processes the first one, any remaining duplicates of the same value are ignored..

I need to be able to update all values inside the array, duplicates as well.

Any ideas how to make this happen? Maybe if the form could check for multiple entries and handle them differently?

View Replies !
Form To Update Multiple Entries In A Mysql Databse
I am trying to create a form to update multiple entries in a mysql databse. This code below is rough, but it is working to the point wher it pulls the data, displays it in the text areas (but it does not go past the first white space in displaying,

that needs to be fixed), and then I can alter the text fields, check a box, and hit submit, and it will update the fields, but the new value is size=20. I also can't update more than one record at a time, which defeats the purpose. Any ideas?

View Replies !
Dynamic List Box
ok, im trying to make a select box (list box) so that its size is dynamic (depending on the amount or records of a given field (medivas), so I can make multiple selections from it. Code:

View Replies !
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 !
Dynamic Mailing List?
I have a schedule of people that need reminders sent to them weekly.  I have figured out how to set a Crontab to send the reminder automatically ... but the people are not the same every week.  I know that I could build multiple scripts and hard code the email addresses, setting a cron job for each - but is there any way to build ONE script that will read a text file based on the date and pull the names/email addresses off of that? 

View Replies !
Dynamic List Order
I was trying to get the list box to display the id numbers in ascending order however the code below does not work, just wondering how to fix it?

<?php
$g = "SELECT * FROM em ORDER BY iD ASC";
$q = mysql_query($g, $link_id) or die(mysql_error());

if (mysql_num_rows($q) > 0)
{
?>
<select name="d">
<?php
while($r = mysql_fetch_assoc($q))
{
?>
  <option value="<?php echo $r['Id']; ?>"><?php echo $r['Id']; ?></option>
<?php
}
}
?>

View Replies !
Generating A Dynamic List
I am tying to write a statement that will compare the values of 2 columns, and display the result in a temp table.

ex. Table A has the following columns: "Minimum" and "Maximum." The temp table will hold the reult of the difference between the 2 columns of table A.

Scope: I am trying to crate a drop down with the resulting data as it is incremented. If Min = 2 and Max = 7, the TEMP tab;e should get the results of 2,3,4,5,6,7. I want to have this result displayed in a drop-down list.

View Replies !
Dynamic Pick List
I have been developing programs in perl and oracle and have recently switched to php. I need to create a form that has four of five seperate pick list on it. Each item in each of the pick list depend on the users previous entry. For instence if the user picks Ford then Taurus, Ranger, Focus,.etc show up in the next pick list then the user picks Ranger and 2 wheel drive, 4 wheel drive, etc show in the next pick list box on so on.

I know how to this if the screen is refresed after each user entry. What I would like to fugure out how to make the screen automatically update each pick list and not refreshing the whole screen.

View Replies !
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 !
Sub Headings In A Dynamic List
I wonder if someone can help me with a problem I am having whilst displaying some external links that are being taken from a MySql database. The code below may not be the best writen but it does work.

I have a database of categories (See SQL below) that are highlighted in blue with yellow text. The contents (See SQL below) of each category are listed below each blue header using alternate green and yellow rows using a type number for each category. Code:

View Replies !
Dynamic Select List
I am wanting a dynamic select list which is populated from my DB. My query is:

  $query = "SELECT pk, type FROM un_styles";

I want to display the type in the select list, then use the selected type. So what i am basically asking is could someone show me the code to do this please.

View Replies !
Dynamic List Content
i'm making a hierarchical Order list for this i've created database where
parameter_cd,parameter_desc,upper_parameter_cd my page is like this Code:

View Replies !
Dynamic Form List
I'm trying to get a dropdown menu where the options are made up from entries in my database. Bellow is what I've tried but it only puts the first item in the list and the rest appear as normal text next to the dropdown box. Code:

View Replies !
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 !
Dynamic List Items
I’m trying to build a multi-level unordered list from a database query. I can't figure out a good way to do this. How can I create this: Code:

View Replies !
Dynamic List Population
Code:

<form action="">
<select name="cars">
<option value="volvo">Volvo</option>
<option value="saab">Saab</option>
<option value="fiat">Fiat</option>
<option value="audi">Audi</option>
</select>

View Replies !
Dynamic List From Sql Table
I would like to put a dymanic select list on a form with the choices coming from a row of a table, table has the structure

id colour1 colour2 colour3

and I would like to give the dropdown the colour associated with the entry for each of colour 1-3 so if a line has

id=sss colour1=red colour2=black colour3=NULL

I would like the dynamic dropdown to have 2 choices, red or black but if the next row had

colour1=red colour2=black colour3=green

it picks up those values instead. The info for each id will be different, I have a table being built populated from the same table at the moment but built from different columns so I have a suitable record set already.

View Replies !
Dynamic List Items Repeating Themselves
I'm working on this online magazine, and each page (well, other than the front page) has a menu included on the right-hand side consisting of articles divided into three sections: articles, columns, reviews. For some reason, whenever I click on one of these article links, that link takes the place of the first link in the section. You can see what I mean here: PHP for the included right_menu.php PHP Code:

View Replies !
Dynamic Checkbox List - DB Update
I have a set of questions which are being dynamically output:

for($i=0; $i<count($question_array); $i++)
{echo $question_array[$i][question] .

"<input type='checkbox' name='question_" . $question_array[$i][id] . "' value='Y'' . "><br>";}

I then want to update each question in the DB. I want to loop through each question id and carry out the relevant action (either enable or disable). What is the best way to do this?? As I am dynamically generating the variable name (e.g. question_50) what is the best way to loop through these updating the relevant id?

View Replies !
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 !
The Dynamic Zone Of List PHP. Please It 's Very Urgent!
I want to create in a form in php two zone of list (A and B).
the options of the zone lists B are dependent on the option chosen in
zone A.

View Replies !
Dynamic Form Option List
I want to create a dynamic drop down option list in a form, but I just can't wrap my head around this.

Both of the below scripts work as intended, but how do I make the mySql query results work with my existing script?  Yes, I know I must replace the "$options = array" part in the top piece of code, but I need a little more guidance than that. Code:

View Replies !
Creating A Sort Of Dynamic List.
I'm wondering how I should go about creating a sort of dynamic list. I have a folder, let's just call it folder, which is filled with files called... file01.jpg file02.jpg and so on, there is also a folder in folder called folder1. These are all contained in localhost/site/.

What I am wanting to do on a php page is list all the "files" inside folder, but not show folder1 in that list, and also for the files to be listed correctly, not like 1, 10, 11, ..., 2, 21, etc.

Plus above some files there will be headings. (These are all links as well to a php page files.php?#) And finally I would like to know how to, instead of displaying the filename, which would usually happen, but instead just cutting off the word "file" and the ".jpg" after the number.

View Replies !
Searching Dynamic Driven List
I have a members database will all their personal details in. I have a page running a SQL query to display a complete list of all these people. This is what my query looks like:

$sql_prop = "SELECT * FROM $db.members WHERE area = '".$_REQUEST['area']. "' ORDER BY name ASC;
$result_prop = mysql_query($sql_prop) or die(error_report("Mysql Error", mysql_error()."

$sql_prop", $_SERVER['REMOTE_ADDR']));

"Error Report" is just one of my functions. I have two forms fields on this page, "Name" and "Address". I want to be able to search the listing that this SQL query has returned for those fields, ie. the user enters "John" in the form field and it returns all entries within the query matching "John". The reason I'm using this:

area = '".$_REQUEST['area']. "'
in the WHERE clause, is just to ensure that the person viewing this list can only see members that are in his area. On the previous page there is a piece of code that gets the session "area" and brings it across to this page. I'm keen on keeping that code in. It works for me at the moment.

Any ideas? How can I search this already filtered list?

View Replies !
Dynamic Form - How To Set Values Of A List
I have a form with a list/menu in it that is populated with records from a database. The items in list#2 are based upon what is selected in list#1.

I have been able to use a combination of php and javascript to get it to work, but the javascript reloads the page to get list #2 to refresh - and that clears out any other fields that have been filled in. Instead of javascript being called for the 'onchange' event for list #1, I'd rather it call php when list#1 is changed and so reset the values in list#2.

OPTIONS:
1. I thought I could have a php function that is called (i.e.   onchange="<?php reload();?>" but I can't figure out how to set the values of the list from within the php function. How to reference form objects with php?

View Replies !
How To Create A Dynamic Dropdown List
how to create a Dynamic drop down list using Mysql.

View Replies !
Dynamic Dropdown List Using Access
I am creating a dropdown list that is populated from an Access DB: Code:

View Replies !

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