Jump to content

Multiple Record form to Database


usadarts

Recommended Posts

Hello All,

 

Need some help here.  I have a form that has header information on the top such as dates, city, state, event, etc.  The detail information of the form has several rows, 32 to be exact.  Each row has 4 fields (name, gender and association).  I named them 1name, 1 gender, 1 association for row 1.  2name, 2gender, 2association for row 2, etc etc etc.  I need each row to be a separate record within the sql database but also carry in the header fields.

 

Is this possible?

 

 

David

 

Link to comment
https://forums.phpfreaks.com/topic/63814-multiple-record-form-to-database/
Share on other sites

Here is the code for the form.  I need a separate record for each name and association.  I need tournament, city, state, event and entries to show in each SQL record.

 

 

<html>
<head></head>
<body>
<form action="post.php" method="POST">
  <center>
    <b><font size="+2">Enter Tournament Results</font><br>
    <br>
    Tournament Name: </b>
    <input type="text" name="tournament" size="50">
      <br>
    <br>
    <b>City: </b>
    <input type="text" name="city" size="20">
    <b>State:
    <select name="state">
      <option value="" selected>Select State
      <option value="AL">Alabama
      <option value="AK">Alaska
      <option value="AZ">Arizona
      <option value="AR">Arkansas
      <option value="CA">California
      <option value="CO">Colorado
      <option value="CT">Connectictut
      <option value="DE">Delaware
      <option value="FL">Florida
      <option value="GA">Georgia
      <option value="HI">Hawaii
      <option value="ID">Idaho
      <option value="IL">Illinois
      <option value="IN">Indiana
      <option value="IA">Iowa
      <option value="KS">Kansas
      <option value="KY">Ketucky
      <option value="LA">Louisiana
      <option value="ME">Maine
      <option value="MD">Maryland
      <option value="MA">Massachusetts
      <option value="MI">Michigan
      <option value="MN">Minnesota
      <option value="MS">Mississippi
      <option value="MO">Missouri
      <option value="MT">Montana
      <option value="NE">Nebraska
      <option value="NV">Nevada
      <option value="NH">New Hampshire
      <option value="NJ">New Jersey
      <option value="NM">New Mexico
      <option value="NY">New York
      <option value="NC">North Carolina
      <option value="ND">North Dakota
      <option value="OH">Ohio
      <option value="OK">Oklahoma
      <option value="OR">Oregon
      <option value="PA">Pennsylvania
      <option value="RI">Rhode Island
      <option value="SC">South Carolina
      <option value="SD">South Dakota
      <option value="TN">Tennessee
      <option value="TX">Texas
      <option value="UT">Utah
      <option value="VT">Vermont
      <option value="VA">Virginia
      <option value="WA">Washington
      <option value="WV">West virginia
      <option value="WI">Wisconsin
      <option value="WY">Wyoming
    </select>
    </b><b>Association: </b>
    <input type="text" name="association" size="30">
    <br>
    <br>
    <br>
<table align="center" border="3">
<tr>
<th>Placed</th>
<th>Players Name</th>
<th>Association</th>
</tr>
<tr>
<td align="center"><strong>1st</strong></td>
<td align="center"><input type="text" name="1name"></td>
<td align="center"><input type="text" name="1association"></td>
</tr>
<tr>
<td align="center"><strong>2nd</strong></td>
<td align="center"><input type="text" name="2name"></td>
<td align="center"><input type="text" name="2association"></td>
</tr>
<tr>
<td align="center"><strong>Top 4 </strong></td>
<td align="center"><input type="text" name="3name"></td>
<td align="center"><input type="text" name="3association"></td>
</tr>
<tr>
<td align="center"><strong>Top 4 </strong></td>
<td align="center"><input type="text" name="4name"></td>
<td align="center"><input type="text" name="4association"></td>
</tr>
<tr>
<td align="center"><strong>Top 8</strong></td>
<td align="center"><input type="text" name="5name"></td>
<td align="center"><input type="text" name="5association"></td>
</tr>
<tr>
<td align="center"><strong>Top 8</strong></td>
<td align="center"><input type="text" name="6name"></td>
<td align="center"><input type="text" name="6association"></td>
</tr>
<tr>
<td align="center"><strong>Top 8</strong></td>
<td align="center"><input type="text" name="7name"></td>
<td align="center"><input type="text" name="7association"></td>
</tr>
<tr>
<td align="center"><strong>Top 8</strong></td>
<td align="center"><input type="text" name="8name"></td>
<td align="center"><input type="text" name="8association"></td>
</tr>
<tr>
<td align="center"><strong>Top 16 </strong></td>
<td align="center"><input type="text" name="9name"></td>
<td align="center"><input type="text" name="9association"></td>
</tr>
<tr>
<td align="center"><strong>Top 16 </strong></td>
<td align="center"><input type="text" name="10name"></td>
<td align="center"><input type="text" name="10association"></td>
</tr>
<tr>
<td align="center"><strong>Top 16 </strong></td>
<td align="center"><input type="text" name="11name"></td>
<td align="center"><input type="text" name="11association"></td>
</tr>
<tr>
<td align="center"><strong>Top 16 </strong></td>
<td align="center"><input type="text" name="12name"></td>
<td align="center"><input type="text" name="12association"></td>
</tr>
<tr>
<td align="center"><strong>Top 16 </strong></td>
<td align="center"><input type="text" name="13name"></td>
<td align="center"><input type="text" name="13association"></td>
</tr>
<tr>
<td align="center"><strong>Top 16 </strong></td>
<td align="center"><input type="text" name="14name"></td>
<td align="center"><input type="text" name="14association"></td>
</tr>
<tr>
<td align="center"><strong>Top 16 </strong></td>
<td align="center"><input type="text" name="15name"></td>
<td align="center"><input type="text" name="15association"></td>
</tr>
<tr>
<td align="center"><strong>Top 16 </strong></td>
<td align="center"><input type="text" name="16name"></td>
<td align="center"><input type="text" name="16association"></td>
</tr>
<tr>
<td align="center"><strong>Top 32 </strong></td>
<td align="center"><input type="text" name="17name"></td>
<td align="center"><input type="text" name="17association"></td>
</tr>
<tr>
<td align="center"><strong>Top 32 </strong></td>
<td align="center"><input type="text" name="18name"></td>
<td align="center"><input type="text" name="18association"></td>
</tr>
<tr>
<td align="center"><strong>Top 32 </strong></td>
<td align="center"><input type="text" name="19name"></td>
<td align="center"><input type="text" name="19association"></td>
</tr>
<tr>
<td align="center"><strong>Top 32 </strong></td>
<td align="center"><input type="text" name="20name"></td>
<td align="center"><input type="text" name="20association"></td>
</tr>
<tr>
<td align="center"><strong>Top 32 </strong></td>
<td align="center"><input type="text" name="21name"></td>
<td align="center"><input type="text" name="21association"></td>
</tr>
<tr>
<td align="center"><strong>Top 32 </strong></td>
<td align="center"><input type="text" name="22name"></td>
<td align="center"><input type="text" name="22association"></td>
</tr>
<tr>
<td align="center"><strong>Top 32 </strong></td>
<td align="center"><input type="text" name="23name"></td>
<td align="center"><input type="text" name="23association"></td>
</tr>
<tr>
<td align="center"><strong>Top 32 </strong></td>
<td align="center"><input type="text" name="24name"></td>
<td align="center"><input type="text" name="24association"></td>
</tr>
<tr>
<td align="center"><strong>Top 32 </strong></td>
<td align="center"><input type="text" name="25name"></td>
<td align="center"><input type="text" name="25association"></td>
</tr>
<tr>
<td align="center"><strong>Top 32 </strong></td>
<td align="center"><input type="text" name="26name"></td>
<td align="center"><input type="text" name="26association"></td>
</tr>
<tr>
<td align="center"><strong>Top 32 </strong></td>
<td align="center"><input type="text" name="27name"></td>
<td align="center"><input type="text" name="27association"></td>
</tr>
<tr>
<td align="center"><strong>Top 32 </strong></td>
<td align="center"><input type="text" name="28name"></td>
<td align="center"><input type="text" name="28association"></td>
</tr>
<tr>
<td align="center"><strong>Top 32 </strong></td>
<td align="center"><input type="text" name="29name"></td>
<td align="center"><input type="text" name="29association"></td>
</tr>
<tr>
<td align="center"><strong>Top 32 </strong></td>
<td align="center"><input type="text" name="30name"></td>
<td align="center"><input type="text" name="30association"></td>
</tr>
<tr>
<td align="center"><strong>Top 32 </strong></td>
<td align="center"><input type="text" name="31name"></td>
<td align="center"><input type="text" name="31association"></td>
</tr>
<tr>
<td align="center"><strong>Top 32 </strong></td>
<td align="center"><input type="text" name="32name"></td>
<td align="center"><input type="text" name="32association"></td>
</tr>
</table>

    <br>
    <br>
    <input type="reset" name="Submit" value="Clear Form">
          
    <input type="submit" name="Submit" value="Submit Form">
  </center>
</form>
</body>
</html>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.