php - From POST form saving the record to the mysql db -
i have done many time form post , saving in mysql db. have form data , when save button data should saved table. have 350 records show in form , when save it, should write table. when records saved table saving 63 records table form actual record numbers above 250 records.
my save.php file follows:
$size = count($_post['sl']); $i = 0; while ($i < $size) { $sl= $_post['sl'][$i]; $item_id= $_post['item_id'][$i]; $item_name= $_post['item_name'][$i]; $query = "insert anothertable set slno = '$sl',item_name = '$item_name',item_id = '$item_id' "; mysql_query($query) or die ("error in query: $query"); ++$i; }
is script fine? or making mistake?
the form script posted below:
<?php echo "<form name='cart' method='post' action='price_add_save.php?supplier_name=$supplier_name_enc&tender_id=$tender_id' >";?> $sql= "(select item_name, item_id, tender_id, slno tender_items tender_id=$tender_id) order slno"; $result = mysql_query($sql) or die($sql."<br/><br/>".mysql_error()); $i = 0; while ($list5 = mysql_fetch_array($result)) { echo '<tr>'; echo "<td width='4%'><input size='1' type='text' id='sl[$i]' name='sl[$i]' value='{$list5['slno']}' readonly/></td>"; echo "<td width='10%' id='addinput'><input type='text' size='15' name='item_name[$i]' placeholder='{$list5['item_name']}' value='{$list5['item_name']}'></td>"; echo "<td width='3%'><input size='2' class='item_id' type='text' name='item_id[$i]' value='{$list5['item_id']}' readonly/></td>"; ++$i; } echo '<input type="submit" value="--save data--" />'; ?>
it issue max_input_vars
in php.ini. changed 1000
5000
..its working fine now. thank all..
Comments
Post a Comment