Previous Thread
Next Thread
Print Thread
Rate Thread
Joined: Aug 2000
Posts: 1,609
Addict
Addict
Offline
Joined: Aug 2000
Posts: 1,609
I know there has to be a shorter way of doing this than what I've come up with.

I am creating a score entry form for a fantasy league for drum corps. Corps are given scores on different aspects (captions) of their show which are calculated together to get a final score.

I am trying to create a form where someone can enter the names of the competing corps at a certain competition along with all of their caption scores, which are then written to the database. Here is an example of what I have come up with so far...
[]http://www.drumlines.org/upload/captions.gif[/]

I have created a table for each corps that contains the captions scores and a competition id for the primary. I want to be able to enter all of the corps' scores on the same form to submit it and have everything be written to each corps' respective database. To accomplish having two entries I have appended "2" to the end of the variables and created a second query.

There has to be an easier way to do this. Does anyone out there understand my ramblings?

This should give you an idea of how I'm doing it...
Code
 <br />// ------------------------------------------- <br />// Add the competition results to the database <br />   $query = " <br />	INSERT INTO fdc_$corps (comp_id,gemus,gevis,musbras,musperc,musens,visperf,visguard,visens,penalty,finalscore) <br />	VALUES ('$competition','$gemus','$gevis','$musbras','$musperc','$musens','$visperf','$visguard','$visens','$penalty','$finalscore') <br />   "; <br />   $dbh -> do_query($query); <br /> <br />   $query = " <br />	INSERT INTO fdc_$corps2 (comp_id,gemus,gevis,musbras,musperc,musens,visperf,visguard,visens,penalty,finalscore) <br />	VALUES ('$competition','$gemus2','$gevis2','$musbras2','$musperc2','$musens2','$visperf2','$visguard2','$visens2','$penalty2','$finalscore2') <br />   "; <br />   $dbh -> do_query($query); <br />

Last edited by DLWebmaestro; 05/19/2004 4:30 PM.
Sponsored Links
Entire Thread
Subject Posted By Posted
Entering data into multiple tables using one form AKD96 05/19/2004 11:27 PM
Re: Entering data into multiple tables using one form JoshPet 05/20/2004 8:33 AM
Re: Entering data into multiple tables using one form AKD96 05/20/2004 9:40 AM

Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Shock Hosting
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
badfrog
badfrog
somewhere on the coast of Maine
Posts: 94
Joined: March 2007
Forum Statistics
Forums63
Topics37,583
Posts293,955
Members13,825
Most Online151,614
Nov 14th, 2025
Today's Statistics
Currently Online 2466
Topics Created 0
Posts Made 0
Users Online 0
Birthdays 16
Top Posters
AllenAyres 21,080
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,834
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2026 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.1.0
(Snapshot build 20260108)