Ok so her is the deal. I am completely new to programming in php. I have a form that will ask the user what type of clubs they have been involved in. They have the option to enter between one and three different clubs. I know it has something to do with arrays but I don't understand how. Ultimately, these rows need to be entered into one of my database tables. I don't understand how to declare the input boxes as arrays on my form. Would each row be a seperate array? And after taht, how do I make sure that each row is placed in my database table as a new row.
Here is my form code:
<form action="insert.php" method="post" >
<table width="100%">
<td height="63" colspan="4"><h3>Other involvement during high school, college (clubs, sports, work, volunteer, etc.): </h3></td>
</tr>
<tr>
<td width="20%"><h3>Activity</h3></td>
<td width="19%"><h3>Position</h3></td>
<td width="23%"><h3>Start Date</h3></td>
<td width="25%" height="60"><h3>End Date</h3></td>
</tr>
<tr>
<td height="63"><label for="Activity"></label>
<input name="Activity1" type="text" id="Activity1" size="15" /></td>
<td height="63"><label for="Position"></label>
<input name="Position1" type="text" id="Position1" size="15" /></td>
<td height="63"><label for="StartDate"></label>
<input name="StartDate1" type="text" id="StartDate1" size="15" /></td>
<td height="63"><label for="EndDate"></label>
<input name="EndDate1" type="text" id="EndDate1" size="15" /></td>
</tr>
<tr>
<td height="63"><input name="Activity2" type="text" id="Activity2" size="15" /></td>
<td height="63"><input name="Position2" type="text" id="Position2" size="15" /></td>
<td height="63"><input name="StartDate2" type="text" id="StartDate2" size="15" /></td>
<td height="63"><input name="EndDate2" type="text" id="EndDate2" size="15" /></td>
</tr>
<tr>
<td height="62"><input name="Activity3" type="text" id="Activity3" size="15" /></td>
<td height="62"><input name="Position3" type="text" id="Position3" size="15" /></td>
<td height="62"><input name="StartDate3" type="text" id="StartDate3" size=" 15"15"15" /></td>
<td height="62"><input name="EndDate3" type="text" id="EndDate3" size="15" /></td>
</table>
</form>
As far as the php code
I understand how to connect to the database but how do i pass the three rows into my table. And if the user only submits for example 2 clubs, how do I omit the third?