473,385 Members | 1,888 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Inserting multiple records!!!

hi, i have to add names of 11 players of a team into database table 'tbl_players'. so i put 11 text boxes in form with a submit button. I tried it with a for loop but its not working. I am working in php.
Nov 27 '07 #1
2 1358
Lumpy
69
hi, i have to add names of 11 players of a team into database table 'tbl_players'. so i put 11 text boxes in form with a submit button. I tried it with a for loop but its not working. I am working in php.
You might want to try a foreach loop, which can go through all the variables in the POST array and insert them.

Something like...
Expand|Select|Wrap|Line Numbers
  1. foreach ($_POST as $key => $value) {
  2. ///SQL insert code here
  3. }
  4.  
Try that and if you still can't get it maybe post some code and we can see if we can help troubleshoot the code with you.
Nov 27 '07 #2
You might want to try a foreach loop, which can go through all the variables in the POST array and insert them.

Something like...
Expand|Select|Wrap|Line Numbers
  1. foreach ($_POST as $key => $value) {
  2. ///SQL insert code here
  3. }
  4.  
Try that and if you still can't get it maybe post some code and we can see if we can help troubleshoot the code with you.
with array it works, thanks
Nov 28 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Brian | last post by:
I need help PLEASEEEEEEEEEEEEEEE..... I am trying to create a list of questions that have yes/no answers. There are 8 groups of questions. Based on who the user is that logs in will determine...
12
by: shank | last post by:
I'm trying to use online samples for submitting multiple records from ASP into a stored procedure. Failing! Through the below form, a user could be submitting many records at a time. I'm not...
7
by: flashguy | last post by:
Hi, Looking online for this related topic that will be exclusively used for MS ACCESS (2000 preferably) is extremely limited. Is it possible to add Multiple records with one click of a buttton...
0
chumlyumly
by: chumlyumly | last post by:
Hello scripters - OS: Mac OSX Language: PHP w/ MySQL database I've created an insert page where a user inputs his info, which then goes to four different tables in a MySQL database. The...
0
by: t8ntboy | last post by:
ASP/SQL Server Express 05 I have two tables, A and B. I would like to insert multiple records into both form A and B, but a field in form B is the Record ID in form A. So, I need to insert the...
1
by: xixor | last post by:
I work for a nonprofit organization that allows individuals to sponsor children overseas. Some of these sponsors decide to become volunteers and speak at their church, university, or other event to...
1
by: sreenu123 | last post by:
How to insert multiple records into a database table that are entered into a datagridview. With a single shot of Save all the records in the datagridview should be updated using C# . Can any one help...
7
by: wozza | last post by:
hi I'm a Dreamweaver user who's created a few simple data entry/ registrations forms in my time, but I'm not really a coder (though I can follow instructions and am not afraid to dabble...) - I...
3
by: Vinda | last post by:
Hi Bytes, Using a previous question as a base Access 2000 Inserting multiple rows based on a date range. I also wanted to insert multiple rows into a table according to a date range supplied by a...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.