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 Records To One


I have a database which comprises of a routes system.. some basic fields like

ID | Routenum | Departure | Destinations | Deptime | Arrtime | Comments

However, I have multiple routes where the Departure and Destination are the same, only the times are different. How could I make it so that only one appears on the routes list, instead of having about 5 similar entries?




View Complete Forum Thread with Replies

Related Forum Messages:
Displaying Multiple Records And Want To Be Able To Update These Records With Different Values.
I am creating a page where I am displaying multiple records and want to be able to update these records with different values.

View Replies !
Multiple Records And DW
I have a table in mysql with this fields

id
equipo
puntos
PJ
PG
PE
PP

I need a php script that show all the records in a way I can update all the data via ony one form. I read the topics post about this tread but still can't figure it out.

View Replies !
Updating Multiple Records
I'll try and explain my problem!!

Database table : Book
Table : BookWords
Fields : BookWordID
Word
Description

I want to show :

The word is $word add your description $description using th code below:


[PHP]$db = mysql_connect("localhost", "root","");
mysql_select_db("Books",$db);

$result=mysql_query("select * from Bookwords",$db);
while ($rec=mysql_fetch_array($result)){

$wordid = $rec["BookWordid"];
$description = $rec["description"];

echo "$wordid: <input type=text name=quantity[$description]><br> ";
}

This is ok so far.
Now i want the user to be able to add the description from the form and have the db automatically updated.

I've tried the different methods I've found on this forum and I cant get anything to work!!!

View Replies !
UPDATE Multiple Records?
Is there a way to update multiple records with just one query, while all of the rows being updated are sent to the query as variables from different input fields?

For example, if I had 5 different text fields, would there be a way to write one query that would update 5 separate records according to the respective input fields? All of the records that need to be updated would have a User ID row in common, so I could use

UPDATE tablename SET qty='$newqty' WHERE user_id='$user_id' AND item='$item'

But I'm thinking I would have to write 5 different queries, one for each text field i.e.

... SET qty='$newqty1' ... AND item='$item1'
... SET qty='$newqty2' ... AND item='$item2'
... SET qty='$newqty3' ... AND item='$item3'

and so forth.

View Replies !
Editing Multiple Records....
Im trying to make it so that I can sort fo like edit all teh records in a table from one page, and im thinking have it like this:

Field 1.........Field2......Field3..

Record1..................................Button to edit the info in this record
Record2..................................Button to edit the info in this record
Record3..................................Button to edit the info in this record
Record4..................................Button to edit the info in this record

View Replies !
Multiple Records Into One Line
I wish to create a table with columns consisting of member name, member e-mail and a column that contains multiple records associated with a single member name:

|  Member name  |  Member e-mail  | Records associated with member |
_____________________________________________________
| member's name |  e-mail address  | record 1, record 2, record 3 etc. |

Each record (those to be displayed in the column 'record associated with member' in the table has a member id linked to it, the member's name and e-mail are in another table also with the member id.  The join between the two mysql tables would be through the member id attribute.

Is there any possible way to put together a script for such a setup?

View Replies !
Insert Multiple Records
am trying to create a 'related articles' selection page. The administrator, after creating an article, can select older articles to include on the final displayed page. As the number of older articles increases, so will the number of possible relataed articles, so i am making a dynamic checkbox as the selection. This is all covered in Dreamweavers features, but, what i then need to be able to do is create a new record in the 'related_articles' table for each article selected when the form is submitted.

I found this post below, which is more or less exactly what i want to do, i just wasn't sure that this was php code, looks like asp. Would someone be kind enough to show me how to change it to php code, or even write the code for me?

View Replies !
Multiple Records Update
I had set up a table like this.

Id
Name
Win
Draw
Lost
Points

I need a page from where I can update all records at the same time. I can update one by one, can show the data, etc etc, but have no idea on how to update or delete multiple records via one single file.

View Replies !
Adding Multiple Records
i have mysql database table named 'table'
it has fields :

id (auto increment) , name , message , category , views

currently i have php script that only adds one record at a time.now i want to add 10 records at a time.

View Replies !
Select Multiple Records
I have an application that uses mysql database. Several records are retrived from the database. To enable users to select multiple records, I've used checkboxes by the side of each record. However, the checkbox does not retrieve their value from the database, neither do they update the database.

I just thought that by setting the value of the checkbox, I could determine the selected checkboxes and insert the corresponding records into the database. The selected records whose checboxes have been set are then inserted into another table. Or updated as I may also need to update some. My problem,however, is how to determine the selected records and then do multiple inserts into the database table?

View Replies !
Saving Multiple Records
I am not sure the best way to approach saving the data that I am displaying. Code:

View Replies !
Multiple Mysql Records
I am trying to develop a form which has the user inputing data in a columnar format. Each column has multiple fields (one for each row) there are 12 columns, I was able to submit to MySql database the first column fields. All subsequent columns would be the same field inputs but the values could be different. I need each column to be submitted to the database as a seperate record by using only one form submit.

View Replies !
Update Multiple Records
a table that contains a list of bidders (a live auction house, not an online auction), the lots they won at the auction, and the total cost of each lot, after they have paid i have the current php scripting displaying their credit card transaction code, etc. On the script to locate them for checkout it search for all the fields where the 'Bidder Number' equals their bidder number. basicly for each item they purchase one new row is inserted, it contains the ID (the primary key), the bidder number, the lot number, and the total for that lot. So if they purchase 5 items there are 5 different rows that contain that info.

The checkout script locates every field where they are the bidder. What I need to do now is after their payment is completed I can submit the data via a form and it will change the column 'paid' to yes, and the column 'auth' to their authorization code from the credit card transaction. How would I do this? the query i use now to get a loop of all their lots and insert them into the credit card processing for is as follows.
+
$sql = "SELECT * FROM checkout WHERE bidnum=$bidder AND paid='no'";

View Replies !
Update Multiple Records Simultanously.
As my subject tells, my problem is to update multiple records simultanously.
The post form in html contains in some cases the possibility to update, say, 4 email addresses (all with the field name "email").

How to process the input for such an update query? Yet, I numerated the email field names simply by stitching the counter in the loop on the field name (while generating the html form). Is this a good way to do it? And how to process the update?

View Replies !
Linking Multiple Records From Another Table
I'm not sure I'm even thinking about this the right way, but here goes:

I have a table of users. Each one of these users may be associated
with none, one, or many records in another table I call a todo table.
table user = 'id', 'name', 'bla bla bla','todo_list'
table todo = 'id','title','other info'

Suppose user 'id=1253' has on his todo list items 756,241, and 672. I
create a string 756,241,672 and store that string in the user's
todo_list field. Then when I want to display the todo items I get the
string with a query, bust it up into an array, iterate the array and
query the todo table.

I have a gut feeling I'm making it way more complicated than need be.
But I can't think of any other way to do it

View Replies !
Update Multiple Records From One Page
Recently, I had a request to create a page in our database web interface where we can update multiple customer records from one page.

Here's the flow of what we want to do:
1. Search for a customer by name.
2. Bring up a list of the matching customers and the data that is to be changed in text boxes in a table - one customer per row with 6 fields for each that can be modified (6 text boxes).
3. People can update the appropriate fields and click submit button.
(** this is done to this point **)

We may be returning as many as 250 records per search, so efficiency would be pretty important. I am not sure where to go from here. I would guess I should build and array of keys and values from the HTTP_POST_VARS that are submitted and then loop through them to UPDATE the database to the new values. I don't know how to do this, though.

View Replies !
Multiple Records Where One Field Matches
I need all of the records where the $topicID = 1,2,3,4

Here's what I have that's working off an array of checkboxes:

$query = "SELECT * FROM expertise WHERE topicID = '$choice[0],$choice[1],$choice[2],$choice[3]'";

I know this is screwed up. The results are less than reliable. It appears to only pay attention to matches for $choice[0] and then lists results that don't match the other choices selected.

View Replies !
Multiple Row Insert - Variable Records
I am wanting to insert into a table multiple rows automatically. I relaise that you can use "VALUES ("string1", "string2"), ("string3", "string4")" to insert multiple rows, but I cannot specify the values I want to insert, and similarly the number of records to insert. Code:

View Replies !
Insert Multiple Records In Table
I want to use a form to insert multiple records into a table. I have an book club where a person would rank a book (3 to 1) next to a particular book read for a particular month. 3 being the most favorite book read that month and 1 being least favorite. Below is the table the records would be inserted into.

Key----Month--------Reader---------Rank-------Book
1-------January-------Jim--------------3----------Bible
2-------January---------Jim-------------2----------Koran
3-------January---------Jim-------------1-----------Torah

How can I have a form where the reader sees only (and fills in) the rank and book text fields, and the Key, Month, and Reader fields are filled in behind the scenes with the default info when the form is submitted .

View Replies !
Updating Multiple Records Of A Table
I would like to update multiple records of a table in the database. Code:

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 !
Updating Multiple Records On Submit
I have a page of results generated by a query and next to each displayed record is a checkbox. On selecting the checkbox(es) and submitting the form, a column in the table will be updated.

E.g.
Name = "blah"
Address = "blah"
Status = "added" [checkbox]

If checkbox is selected, the column 'Status' will be updated to a new value.

Can anyone explain the concept of what I need to do so I can have a go at working it out (if my explanation makes any sense)?

View Replies !
Deleting Multiple Records With Implode
My question is about deleting multiple records (selected checkboxes).

mysql_query('DELETE FROM instant messages WHERE msg_id IN ('. implode(', ', $_POST['msg_id']).')');

It works OK, but it's important to check that users can delete only their own instant messages but not messages of other people.

mysql_query('DELETE FROM instant messages WHERE uname='$username' and msg_id IN ('. implode(', ', $_POST['msg_id']).')');

It doesn't work - I am getting parse errors. Any ideas?

View Replies !
Updating Multiple Records In A Recordset?
Back in my OOP/ADO days you could query the database, get a recordset object, modify any records you wanted to in your calling app, then "batch update" the recordset back to the database.

Does PHP support something similar to this? For example if I have 10 records and I need to set field 'x' = a different value for each record, do I have to execute 10 queries against the database, or can I update them through the mysql_result and flush them all at once? Hope that makes sense...

View Replies !
Inserting Multiple Records From 1 Form. How?
i have a page that lets you input a number which is passed to a php script that generates rows of textboxes / records (first name, last name). how do i pass these rows / records into the database? Code:

View Replies !
Displaying Database Records Over Multiple Columns
I am currently using the following to generate a table with a single column with ten entries PHP Code:

View Replies !
Inputting Multiple Records At Once To Mysql Via Text Box
I was wondering if anyone can point me in the right direction. I wanted to create a text box, as seen in some scripts, where you input various fields of information, separated by commas and the script inputs those fields into the db.

View Replies !
Delete Multiple Records In The Same Database Querie?
I have some code that deletes records from the database, in a loop. However its prety inificient as it makes a seperate database call in every loop whcih is slow. PHP Code:

for ($i=0; $i<count($idarray); $i++)
          db_query("delete from clicks where id='$idarray[$i]'");

Is their a more efficient way of doing that? It is posible to delete multiple records in the same database querie?

View Replies !
Adding Multiple Records To A Table In One Form.
I have one form in a php page. In that form there are several rows, each with several input boxes. These rows represent individual products and their price.

You may add as many products as you want by clicking a add product button and it will add another row using javascript.

When you are finished adding your products you then click submit. For each product I would like it to insert an individual record in the products table.

For example if you add 10 products, when you click submit it will add 10 records in the product table.

View Replies !
Select Multiple Dates' Records From MySQL DB
I need to select multiple records from a MySQL DB based on one date value that I get from a form.

When I get the date from the form I need to get the values for that date and for the six days before that to display the full week's data. Code:

View Replies !
Setting A Flag In Multiple Records W Checkbox
I have browsed this forum back and forth and found many tips but they are (for me) incomplete and not fully working. I have to go down to basics...and to post my entire page so that those of you that know what you are doing, Code:

View Replies !
MySQL Inserting Into Multiple Tables Linked Records
Using MySQL can anyone tell me how to most efficiently insert a collumn
in 'table1' retrieve the id from this record and insert mutliple
records into 'table2' with a collumn for the id in 'table1' which links
the two recordsets

View Replies !
Display Records From A MYSQL Database On Multiple Pages.
I am trying to display records from a MYSQL database on multiple pages. I get the following error when I attempt to display the results

mysql_fetch_array(): supplied argument is not a valid MYSQL result in

c:intentpubwwwrootprogeneefsires1.php on line 238

The code is shown below. I am including a file called class.pager.php for page numbers (author: Tsigo) and this part works fine.

/* Now we use the LIMIT clause to grab a range of rows */
$result = mysql_query("SELECT sireid, sirename, sirethumbpic, comment_1,comment_2,comment_3 FROM beef".$start.", ".$limit);

View Replies !
Need To Update Multiple Mysql Records With A Single Form Submit
I have a wish list like a shoping caty based on a mysql databse where i retrieve records with php I need to update the quantity which is in a text fields :

input type = text name = quantity[] value = $quantity
input type = checkbor value = $id name = id[]

I need to update quantities based on the primary id represented with id with a single submit.

View Replies !
Displaying Priorty Records And Normal Records In The One Dataset.
I have a page which displays the records from the database and uses paging to display the records in groupes of 10 per page.

I now want to be able to show results depending on the database field (display) in the database (can be set to either "full" or "limited"). If the record and the field display is equal to "full" i want to then display this record at the top of the record set and display all the fields.

If the record is equal to "limited" i want to display different results and they must show after all the records which are equal to "full". I can't output two different recordsets as i use paging and only want to show 10 records per page. Code:

View Replies !
DELETE RECORDS - Database Adding New Records
iv got the database adding new records, and now I want it to display all of the records that are there buy name and id number, then i want u to be able to type in the id number of the customer u wish to delete and it shoudl delete it, sounds good buts its not actually deleting the record. it says it does, but its not doing it. Code:

View Replies !
Problems With The Listing Of Records, Editing Of Records
I'm having problems with the listing of records, editing of records, and deleting of records. I'm not sure what I'm doing wrong.

The listing script is calling the add entry script. So I add the record, the database is updated, and nothing else happens. I don't get a list of records from that table.

When I did SQL programming off the mainframe, you did a simple select statement. I'm not sure why the PHP list script is calling the add entry script. Code:

View Replies !
Can You Pull Multiple Pages Somehow Using Multiple Curl_exec's Before Calling Curl_close?
so after mulling over some way to use keep-alives with fsockopen I figured it would be easier to just switch to CURL which happens to support a ton of stuff including persistent connections.

I did some reading and all I could find was to take advantage of persistent connections one only has to specify multiple URLS with setopt before calling exec:

curl_setopt($ch, CURLOPT_URL, "http://www.example/");
curl_setopt($ch, CURLOPT_URL, "http://www.example.com/anotherpage.html");

and so on...

I put together a test script to see how the output would look but all I found was the last URL being displayed where I expected to see all specified pages spit out one after another in one page.

Am I doing this wrong, or maybe my home wamp setup isn't configured properly?

Perhaps the persistent connection thing is for the same curl session.. can you pull multiple pages somehow using multiple curl_exec's before calling curl_close? or are you supposed to call curl_close once the page is downloaded and before doing functions on the output?

View Replies !
Selecting Multiple Values From Multiple Tables Using Checkboxes
I've been struggling with this for a bit but cannot seem to find a simpler, cleaner way of doing this.

a. I have a Table A - Customers , Table B - Contacts .
b. I have a form where a user types the first few alphabets of a customer name and then gets a list of contacts, cities.
c. The user is supposed to select multiple options from this list and then send that data to another form for processing.

I'm able to only pass data from Table A, not from B . Could someone please have a look at the 2 snippets of code and advise? And is there a way both these php scripts could be combined in a single one ? Code:

View Replies !
Grabbing Data From Multiple Tables For Multiple Requests
Here's what I'm trying to get at.

A table that displays all the Process Server's name, the number of summons's he has out within 7 days, 7-14 days and 15+ days...pretty simple, it's just a report so management can stay on top of how many papers are out.

I've got the server_information table with the server name and ID. and a case_information table with the serverID.

I've got a while loop that displays all the server's name, the problem is when I try to get the # of cases....here's what i've got so far. Code:

View Replies !
Multiple-combo - Multiple Mail Recipients
I am new to scripting but trying to create a page that lets users create an e-mail (mailto after having chosen from two drop-down menus (arrays).

I have managed to do so in HTML by using a Java script borrowed from Randall Wald (http://www.rwald.com).

However, I don't want the e-mail addresses to appear in the page to avoid spam. Is there a way to do so by using PHP?

P.S.: The first array contains (University A, University B) and the second array (Faculty, Staff, Students), i.e. 6 different e-mail addresses

View Replies !
To Search Multiple Words In Multiple Fields
I have a $phrase made of some words.Every query has a number variable of words. I would sort of my_table all records that have at least 1 word of the $phrase into field_a AND/OR field_b of my_table.

View Replies !
Multiple Users, Multiple Tables, One Form
I have a small group of users that will submit their 'goals' via one form (placed in a postnuke block). I have created one table (mysql) for each user to collect collect their goals. I need some direction in writing the php that will submit the form data to the correct table based upon the users Postnuke login.

View Replies !
Multiple Row Inserst From Multiple Line Textbox
I've been search for some help with this because I know someone has done it before. I'm trying to have a textbox and insert into a table one entry from each line of the textbox.
So if the textbox contained:

This info
That info

It would insert into the table
----------------
|1|This info|
|2|That info|
---------------

View Replies !
Extracting Multiple Multiple Matches Using Regex
I have used simple regex for extracting URLs from a page or string of text, but it would be useful to get both the URL and the text within the A ref tag Code:

View Replies !
Multiple Multiple Select Boxes
I'm looking to have multiple multiple-select-boxes on a page. But I
can only get the contents from the last selected value within a box,
via PHP. I've tried numerous methods. What am I doing wrong?

You can see ALL the values present in the url:
http://myserver/test.php?notify_use..._updcats=Update
e.g.......

View Replies !
Multiple Forms/Multiple Submit
I have a form consisting of five pages. I don't want to program all five pages in one script because it's too much scrolling. So, I'm creating five form scripts, one for each page. When I reach page 2, I would like to show a button which will bring people back to Page 1 and a second button which will bring them to Page 3.

View Replies !
DNS Records
Hey everyone, I'm trying to get a DNS record of an IP using PHP's checkdnsrr() and getmxrr(). I used

echo checkdnsrr($REMOTE_ADDR);

and

echo getmxrr($REMOTE_ADDR);

but I receive an error that the PHP build does not support it, but I am using PHP 4.0.5 and in the manual, it shows that PHP 3 and 4 supports the two commands. Any help?

View Replies !
Next N Records
how do I create a "next n records" interface? I want to initially output a specific number of rows, and have a next/previous scenario where the user can click on either and scroll forward or back through the records. I'm currently outputting all rows through mysql_fetch_array: Code:

View Replies !
HOW TO GET HOW MANY RECORDS YOU HAVE IN DB
I finally discover the way how to get what I need.

Let's look to my code:

----------------------- CODE ------------------------>

$res = @mysql_query("SELECT COUNT(*) AS ToT FROM table_name");
$dato = mysql_fetch_array($res);

echo($dato[ToT]);
----------------------- CODE ------------------------>

With this code you will get how much records do you have in DB.

PS:
Whan you think that everything is over and that you are at bottom of
trying push harder to see what is under.

View Replies !
Last 5 Records
is there an easy way to grab the last 5 distinct records from an unindexed database?  (php/mysql)

View Replies !

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