Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 322
  • Last Modified:

Multiple Insert to table

I have developed a training registration web app. I am tryiing to add attendance tracking to it. The problem I have is when the trainer selects the class, they get a listing (detail page) of all the students who have registered. I added a field called (attended - yes \ no) to my table and add a check box to the listing. When I submit the form, all the students update 1 record.

How do I do submit multiplte records to the database. I saw something that showed how to update multiplte table (with 1 record) utlizing commands, but I have not used this function yet.
0
jkatz2
Asked:
jkatz2
1 Solution
 
Saqib KhanSenior DeveloperCommented:
jkatz2 I need more Details about your Questions.
What you trying to say this You want to update MULTIPLE Tables by doing one Click or Multiple Fields within one Table?

if Multiple Tables Then run your Code Line BY Line to do whatever you want, if Updating one Table and Multiple Fields then all you have to do this Update/Modify your Sql Statement.

Let me know what you need.
0
 
jkatz2Author Commented:
I need to update 1 table with several records. I have a listing of customers Fname \ Lname \ ect, and a field (attended) that needs to be updated for each record. There can be up to 20 records showing?

0
 
Jim MCommented:
jkatz,

I think I know what you're getting at...but your terminology  was confusing me. You aren't submitting (i.e. inserting) multiple records to the db, you're updating multiple records.

There is a good, relevant tutorial at:

http://www.newmanzone.com/recipes/recipe.asp?LinkID=1

Those he's talking about batch deletes, the concept is exactly the same for you, except you're going to be updating.

The general idea is that each checkbox needs to be unique (i.e. the registants memberID or whatever you're using). Then you have to do a little hand coding to loop in the update statement

Here's an exaple of what your checkbox code should be like:

<input name="MM_recordId" type="checkbox" id="MM_recordId" value="<%= rsGetMembers.Fields.Item("MemberID").Value %>">

Basically your form will have all the folks - each in a separate row - with a checkbox for registered/not registered beside each. You go down the list, check the ones you want, then submit the form.


There is very little hand coding required to do this, and you'll find this is very easy to do!

Any questions, just ask. Hope this helps!

-g8tor23
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now