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 Complete Forum Thread with Replies
Related Forum Messages:
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 !
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 !
Adding A Number To All Records
is there a query structure that will enable me to add, say, 10 to all records in a certain column without doing 2 queries for each record (one to get the current value and one to update it with the new value.
View Replies !
Eliminating Spammers From Adding Records?
I have a website that allows users to add records for their events. Recently I've had a bunch of spammers coming in. Do you have any tips on how to keep them from entering bogus information. I have started checking for any "http" in some of the fields but I want to make it even harder for them. Is there a way to check what the referring page is and if it is not the right one to produce an error?
View Replies !
Prevent Adding Duplicate Records
theres a XML file located on the internet. every week or so. this xml file gets updated with one or two new entry's. i have a php script which can read all the entrys i want from this xml file. and then put it into a database. the problem is say i run the php script again to update the database and add the new entry's that the xml file has. every thing gets added again. each time the script is run. the enter xml file entry's are added again. so the database get full with duplicates triplcate records ect ect. how would i go about preventing the same record being added over and over.
View Replies !
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 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 !
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 !
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 !
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 !
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 !
Adding Multiple Columns
I'm planning on migrating the existing table (member table as is, data and schema) and then wish to add the new columns after an existing column (eg password) and am wondering do I have to add each column at a time with multiple sql statements or can I add them all in one sql. Additional columns: `invisible` set(Ƈ',Ɔ') default Ɔ', `pmfolders` text NOT NULL, `saveogpm` char(3) NOT NULL default '', `emailonpm` char(3) NOT NULL default '', `useoldpm` char(3) NOT NULL default '', `webcam` varchar(75) default NULL,
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 !
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 !
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 !
Adding Values Together From Multiple Results
I have a script that returns a set of results from a 'transaction' database table. One field is called 'amount'. What I would like to do is be able to mathmatically add the values from the results together and output a 'Grand Total' result. Code:
View Replies !
Adding Multiple Values In Select Box To Db
Does anyone know how to add multiple values from a select box to a mysql table? Here's the code I'm trying to use to add multiple values: foreach ($_POST['section_id']) { $sql3 = "UPDATE $table_name13 SET date_id = '$_POST[date_id]', section_id = '$_POST[section_id]'"; $result3 = @mysql_query($sql3,$connection) or die(mysql_error()); } Of course, this is not working. Anyone have any thoughts on how I might do this using PHP?
View Replies !
Adding Values In Multiple Rows
How can i add the quantites to display on my cart? my db table is like this: item--qty--sub 05abc 5 SM 05abc 10 MD 05abc 10 LG I can get this info to display on my cart, including the number of items (# of rows based on my select query, in this case is 3) but I need to display the quantity which should be 25. I know its just a matter of adding...but i'm stumped here.
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 !
Adding Multiple Listbox Items To Mysql
I want to be able to select multiple items from a listbox in a form and send the result to mysql blob. I only get one item to the bd. Here is part of the script. Item: <select name="itm" align="bottom" multiple size="2"> <option value="item1">item1</option> <option value="item2">item2</option> <option value="item3">item3</option> <option value="item4">item4</option> <option value="item5">item5</option> </select> "Insert into xyz set itm = '$itm'";
View Replies !
Adding Multiple Rows To Table Using Checkboxes
I'm looking to select using checkboxes certain rows from the results of 'table a' and add the selected rows to another table using checkboxes. I Have had limited success adapting some code for deleting multiple records using checkboxes. Code:
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 !
Adding Multiple Items In Shopping Cart W/ One Click
On the product page, I have the option that if a customer would like to add extra "products", then they would click on the desired checkboxes to add what they would want and then when they click on the "finish purchase" link, they would be directed to the cart page with their selection or selections shown. Code:
View Replies !
Array Query - For Adding Alt Text To Multiple Image Upload Form
I've set up a form for uploading multiple images and I am writing the urls to a database, which is queried and outputs the images on a web page. This works fine, however, I also want to add alt/title text for each image upload but can't quite seem to get it working. I'm pretty new to PHP so my knowledge of how to use arrays is fairly limited. Code:
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 !
|