I am a total noob with php and mysql so I hope you guys can help me. I have a form that has a button where a user can add a set of input fields dynamically. I am using append to generate the fields. I was reading a tutorial about it so i understood that part. Here is the site where I based my append script on ,link here. My problem is how do I construct the foreach loop for the sql query if I have a set of fields and not just one input field like that website is showing as an example? Here is what my append looks like (I am just showing 4 fields but in total there is 16 fields per set of the append.) I want to upload the post data to a sql db. I've been searching the site but I was only seeing samples of foreach loop for a single input field not like the set that I have.
Thanks very much and I hope someone can give me an idea on how to proceed on this.
<script type="text/javascript">
var count = 0;
$(function(){
$('p#add_field').click(function(){
count += 1;
$('#row-fluid').append(
'<div class="span12" style="border-bottom:1px lightgray solid; padding:10px 0px;">'
+'<div class="row-fluid"> '
+'<div class="span1">'
+'<label> </label>'
+'<label class="radio"><input type="radio" id="process_where' + count + '" name="process_where[]' + '" value="Online" onClick="checkProcessType(this.value)" >Online</label>'
+'<label class="radio"><input type="radio" id="process_where' + count + '" name="process_where[]' + '" value="In-store" onClick="checkProcessType(this.value)" >In-store</label>' +'</div>'
+'<div class="span1">'
+'<label> </label>'
+'<label class="radio"><input type="radio" id="status' + count + '" name="status[]' + '" value="Actual" onClick="checkStatus(this.value)" >Actual</label> '
+'<label class="radio"><input type="radio" id="status' + count + '" name="status[]' + '" value="Ghost" onClick="checkStatus(this.value)" >Ghost</label>'
+'</div>'
+'<div class="span1">'
+'<label>Type</label>'
+'<select id="upg' + count + '" name="upg[]' + '" onChange="checkExp(this.value)" class="input-small" >'
+' <option value="" selected=" " > </option>'
+'<option value="Exp" >Exp</option>'
+'<option value="Post" >Post</option>'
+'<option value="Upgrade" >Upg</option>'
+'<option value="Retail" >Retail</option>'
+'</select>'
+'</div>'
+'<div id="upg' + count + '" class="span2">'
+'<label>Full Date</label>'
+'<input name="upg_date[]' + '" id="upg_date' + count + '" type="text" id="upg_date" placeholder="YYYY-MM-DD" class="input-small" />'
+'<img id="jscalendar' + count + '" type="image" src="img/calendar.png" style="border-width:0px; width:16px; height:16px; background-color:#FFF; margin-bottom:-7px;" onclick="createPopCalendar3()">'
+'</div>'