Jump to content


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


multiple entries, one form

Recommended Posts

I'm sure there's a name for what I'm looking for, I just don't know it, or how to do it. Basically, I have a form for people to enter their teams. So they would put the name for team, then each person's name, e-mail and phone. I then want these to enter into the database in 4 fields. Team Name, Name, E-mail, Phone...but for each person. So how would I do such a thing? Thanks in advance. I really appreciate it.

Share this post

Link to post
Share on other sites
[code]<form action="update_db.php" method="POST">
<!-- <1> -->
<input type="text" name="1team">
<input type="text" name="1name">
<input type="text" name="1email">
<input type="text" name="1phone">
<!-- </1> -->
<!-- <2> -->
<input type="text" name="2team">
<input type="text" name="2name">
<input type="text" name="2email">
<input type="text" name="2phone">
<!-- </2> -->
<!-- <3> -->
<!-- </3> -->

$max=3; //the number of "Sets" we got
mysql_query("INSERT INTO `table_name` VALUES ('$team', '$name', '$email', '$phone')");

Of course you need to add validation, SQL injection protection etc'. But that's the main idea :)


Share this post

Link to post
Share on other sites


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.