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.





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 Complete Forum Thread with Replies

Related Forum Messages:
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 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 !
Get Some Data From A Database And Then Add All Of The Entries In Each Column
Im trying to get some data from a database and then add all of the entries in each columb to get the total for each columb.  I tried it with the following code but got the error: Warning: Invalid argument supplied for foreach() Code:

View Replies !
Number Of Identical Entries In MySQL DB Column
How do you display the number of times a particular entry appears in a column of a database?

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 !
Return A Column List
how would i go about returning a list of columns in a table? and is there a way to also return the datatype?

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 !
List Db Results Vertically In 2-column Table
i'd like to display mysql query results in a two column table, however, with the results displaying vertically starting in column 1 then continuing into column 2.

View Replies !
Unknown Column 'icaodesc' In 'field List'
I'm getting the following error message...

Unknown column 'icaodesc' in 'field list'

when I try to update a table from a PHP form.

What 'field list' is it referring to? My PHP script or the MySQL
table???

Here is the PHP script I'm using...

<?php

//set up table and database names
$db_name ="xxx";
$table_name ="yyy";

//connect to server and select database
$connection = @mysql_connect("localhost","user_name","password") or
die(mysql_error());
$db = @mysql_select_db($db_name,$connection)or die(mysql_error());

//build and issue query
$sql ="UPDATE $table_name SET
icaodesc ='$_POST[task_icaodesc]',
icaosource ='$_POST[task_icaosource]',
icaonote ='$_POST[task_exp_outcome]',
usposition ='$_POST[task_usposition]',
expoutcome ='$_POST[task_exp_outcome]',
usposition ='$_POST[task_usposition]',
usaction ='$_POST[task_usaction]'
WHERE task_id ='$_POST[id]'";

$result = @mysql_query($sql,$connection) or die(mysql_error());
?>

icaodesc was the NAME in the updatable form. task_icaodesc is a
"good" field in the table yyy

View Replies !
SQL/DB Error -- [Unknown Column 'M' In 'field List']
I have a simple form element that drives me nuts. Here's the code: PHP Code:

<input type='radio' name='gender' value='M'";
    if ($usr->act_gender == 'M') { echo " checked"; } echo "> Male
&nbsp;&nbsp;&nbsp;&nbsp;
<input type='radio' name='gender' value='F'";
    if ($usr->act_gender == 'F') { echo " checked"; } echo "> Female

When the form submitted it should PHP Code:

("UPDATE act_details
SET ... gender=".$_POST['gender'].", ...
WHERE ID = '".$user."' LIMIT 1")

But I keep getting the following error: Quote:

SQL/DB Error -- [Unknown column 'M' in 'field list']

Even Thought I have such a field in my db table.

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 !
Invalid Query: Unknown Column In 'field List'
I'm getting this error when I execute my form and it brings up the corresponding .php page.

Invalid query: Unknown column 'DCS' in 'field list' Whole query: SELECT DCS#, CLIREF, GUAR, PAT, ADDR1, ADDR2, CITY, ST, ZIP, SS#, DOB, PHONE, DBAL, TBAL, PAID FROM crossroads10 WHERE CLIREF='ZQ02037/8558'

Here is my code:

View Replies !
Error: Unknown Column 'OOM210' In 'field List'
Can someone tellme why I get the following error?

Error: Unknown column 'OOM210' in 'field list'

$flightnumber is equal to OOM210...

(INSERT INTO and VALUES are on the same line, but here it is split so it is easier to compare.)

$sql = "INSERT INTO flights (flight_num, dept, dest, depticao, desticao, depttime, desttime, stops, duration, freq)
VALUES ($flightnumber,$departure,$destination,$departurecity,$destinationcity,$departuretime,$arrivaltime,$stop,$duration,$freq)";
  if (!mysql_query($sql,$con))
  {
  die('Error: ' . mysql_error());
  }

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 !
Select From Drop List To Fill Table Column With Text -- HOW ?
I want viewers to compare state laws on a single subject.

Imagine a three-column table with a drop-down box on the top. A viewer
selects a state from the list, and that state's text fills the column below.
The viewer can select states from the drop down lists above the other two
columns as well. If the viewer selects only one, only one column fills. If
the viewer selects two states, two columns fill. Etc.

I could, if appropriate, have a separate htm page with the text for each
state -- california.htm for example. When the viewer selects California from
the drop down list, the column below would "fill" with California.htm.

Or, I could conceivably use a text or mysql database with two fields for
each record: state_name and law_text -- but it would probably be easier to
use separate htm files, since there will only be about 20 states involved,
and the "database" would never have a large number of records.

The table width would be 100% and each cell would be @33%

My site is designed with FP 2002 and runs on Apache/FreeBSD. I have just had
Apache-ASP installed but I have not yet configured or used the module.

View Replies !
Book ERROR: Unknown Column 'Fredrik' In 'field List'
In confused with this problem, My code looks like this:

$sql="INSERT INTO calendar(year, month, day, name)
VALUES('$year','$month',".$_GET['day'].",".$_SESSION['name'].");

the table structure of "calendar" is

year TINYINT(4) notnull
month TINYINT(4) notnull
day TINYINT(4) notnull
name VARCHAR(30) notnull

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 !
Multiple Column Output
I want to display a prod catalog wid prodname, color, image etc as 2col x 3 rows, like:

prod1 | prod2 |
colr1 | color2 |

prod3 | prod4 |
color3 | color4 |

and so on...

I have this code, which gives the desired results, but all columns in one line.. i.e.

prod 1 | prod2 | prod3 | prod4 |
color1 | color2 | color3 | color4|.. and so on

i want two columns for each two products, and then rest of two down.. adn so on PHP Code:

View Replies !
Search Multiple Column Query
I have some code, this isn't all of it, I figured this is the bit I need to change :

$query = "select * from companies where company  like  "%$trimmed%"   order by company"

I want it to search multiple column like 'tel' as well as 'company'

I've tried:

$query = "select * from companies where company, tel  like  "%$trimmed%"   order by company"

But doenst seem to work. Can anyone tell me what to change or should I post the rest of the code so someone can help?

View Replies !
Searching A Mysql Column Against Multiple Variables
I have an array of zipcodes which I am trying to check against a mysql table. I want to search in the column "zipcode" in a table of a bunch of entries. I want to search each rown to see if the value of the zipcode column is listed within my array.

This could be said vis vera, that I want to check the mysql table to see if any of the rows have one of the values from the array inside the zipcode column.

I've tried the statement

"select * from table where zipcode IN ('$zipsearch')", but it seems to return an odd sequence of data. It doesn't seem thurow enough.

similarly the entire statement is :
select * from table where description like "%$trimmed%" OR title like "%$trimmed%" AND zipcode IN ('$zipsearch') order by date"

I can't seem to get the statemtent to break up my requests right so that the logistics of teh statement are :

select from table where (descriptions like variable or title like variable) AND <zipcode search problem>

View Replies !
Searching Sql Table (same Column) For Multiple Values
Basically I want the user to click a link and the database be searched for around 25 values from one column, and then return all the details from each of those rows (and alphabetize them).

Pretty much i have a table full of address details, phone numbers, post codes, etc
and I want to use the post codes as the basis of defined areas. Therefore, I have lists of the post codes for each area.

I have used url parameters in the past ie searchresult.php?post_code=7655 so i tried putting commas in between values ue searchresult.php?post_code=7655,7654,7652 but obviously this doesn't work... I'm thinking it's going to be a bit more complicated than this..

View Replies !
Multiple Column Output For Search Engine
I managed to get it working just fine. My problem is that I can't get the search results to display in multiple columns, I get one column with all the results instead. I figured out how to display data from the db horizontally but on a different page that has nothing to do with this one, I just can't figure out how to do it here. Code:

View Replies !
Multiple Column Output - Put Values Into Certain Columns Based On The ID
Trying to streamline my code to output a "SELECT ALL" query into multiple columns of the same table. Right now it's set to put values into certain columns based on the ID (INT, Autonumber). However, some of the items got deleted, creating gaps in IDs - messed
everything up.

View Replies !
Multiple Value List
I'm trying to input a form onto my page, where the user can select from a range of different sports, and more than one sport can be selected. I'm not sure how I go about writing the code so that it's entered into the mySql table that I have set up - I want it to go into one field in the table called Sport or something along those lines. I can write the code for just one value to go in but I'm not sure about when there's more.

View Replies !
List Box Multiple Select
I am trying to create a drop down list that permits a person to select multiple items from the list and have the results posted on a results page. I am using Dreamerweaver MX, PHP and a MYSQL database. I was able to select multiple items but only the last selected item would be displayed. I tried to modify the list box code and now it returns nothing. Code:

View Replies !
Multiple List Selection
I am still learning PHP, which is the best language for database driven sites. I am using Dreamweaver CS3 with the devleopers toolbox which is "ok" to help take the guess work out of things.

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.

View Replies !
Multiple Select List Box
I have a task where I have to fetch datas from mysql and display it in the multiple select list box. I have fetched the datas and it is getting diplayed correctly in the multiple select box. I have used some thing like this.

print "<select MULTIPLE SIZE=&#396;' name='db_test[]'>";
while($row = mysql_fetch_object($handle))
{

if($num 0) /*num is number of rows*/
{
print "<option value='$row->db_name'name='$row->db_name'>".$row

View Replies !
Multiple Select List
I have a form that inserts it's values into a table in a mysql database.. i also use another form to edit the contents of that table...

My problem is that i have a multipe select list ... i imploded it's values into the table like this:

$employees = implode(',',$_POST['emp_name']);

that worked fine ... but i can't figure out how to make the same values selected on my edit form's list?

View Replies !
How To Remove Last Comma From A Multiple List?
I have a multiple select list in my site where the values are inserted in a database table, in a column named available_country. I enter these values in the db separated with comma. I don't know however how to remove the last comma so it will be something like this:

USA, Europe, Asia

and not:

USA, Europe, Asia,

Here's what I tried but it didn't worked: ...

View Replies !
Multiple List Values To One Field
I'm trying to figure out if there is a way to input multiple selections from a list in a form field into one field in MySQL. Right now my list is only inputing the first value selected and not the others.

View Replies !
Multiple Delete From A List Of Records
If I have a list of records from a database on the screen, each with a check box beside them, how would I delete all the records that have been ticked? I assume I would use a variable similar to checked[], but not sure what syntax I would use to remove them from the database? Would I loop round each record comparing the checked[] value and it it's set, delete the record?

View Replies !
Read Entries From DNS Servers And Ping The Entries
i need to build a script that will let the website i'm currently building to read entries from DNS servers and ping the entries to see if they're alive. the problem is i have no idea how to 'read the DNS entries'.

View Replies !
Multiple Drop Down List Problem And MySQL
I am trying to populate around 30 drop down lists via a single query to a mySQL database. The problem is how to make sure that each drop down list only display it's relevant data. for example the table is as follows:

View Replies !

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