generating table rows during runtime and saving it to mysql database

tatSleceBoodo

New Member
hi i am new to php and i am working on a php form which has a table in it and creates a table row wen a button is pressed, but since the generated rows contains different names i am stuck to how do i save it in mysql database. can anyone help me out on this?here is my javascript code this works fine \[code\]<script type="text/javascript"> function deleteRow(row) { var i = row.parentNode.parentNode.rowIndex; document.getElementById('POITable').deleteRow(i); } function insRow() { console.log('hi'); var x = document.getElementById('POITable'); var new_row = x.rows[1].cloneNode(true); var len = x.rows.length; new_row.cells[0].innerHTML = len; var inp1 = new_row.cells[1].getElementsByTagName('input')[0]; inp1.id += len; inp1.valuehttp://stackoverflow.com/questions/14437056/= ''; var inp2 = new_row.cells[2].getElementsByTagName('input')[0]; inp2.id += len; inp2.valuehttp://stackoverflow.com/questions/14437056/= ''; x.appendChild(new_row); }</script>\[/code\]here is my html code,\[code\]<table id="POITable" border="0px" size="100px" cellspacing="0" cellpadding="2"> <tr> <td width="10" align="center"><label class="description">Srno.&nbsp;</label></td> <td width="118"><label class="description">Moallim Name</label></td> <td width="118"><label class="description">Mobile</label></td> <td width="118"><label class="description">Qabiliyat</label></td> <td width="10"></td> <td width="10" align="center"></td> </tr> <tr> <td>1</td> <td width="210"><input size="40" maxlenght="40" type="text" id="moname[]"/></td> <td width="80"><input size="10" maxlenght="10" type="text" id="momob[]"/></td> <td><select name="cmbmuallim[]" class="element text large" style="font-size:18px;"/> <option value=""></option> <?php mysql_connect("localhost", "root", '') or die(mysql_error()); mysql_select_db("webapp") or die(mysql_error()); $result = mysql_query("SELECT `name` from qabiliyat ") or die(mysql_error()); while ($year = mysql_fetch_array($result)) { echo "<option value='http://stackoverflow.com/questions/14437056/$year[name]'>$year[name]</option>"; } ?> </select></td> <!--<td><input size="45" maxlenght="10" type="text" id="momob"/>&nbsp;</td>--> <td><input type="button" id="addmore" value="http://stackoverflow.com/questions/14437056/+" onclick="insRow()"/></td> <td align="center"><input type="button" id="delPOIbutton" value="http://stackoverflow.com/questions/14437056/-" onclick="deleteRow(this)"/></td> </tr></table>\[/code\]but since i dont know how do i save it i am stuck right here please help me out
 
Back
Top