Updating multiple fields in a table form in one submit with PHP -
i attempting create form within table can update inventory numbers of chemicals have on hand, changes daily. want values in mysql populated text box, can edited , update current inventory values edited new inventory number submitted @ once 1 click of submit button.
from research have found, looks array allow me this, have yet work.
this far have gotten. can print table , insert values in text boxes, when go update them either nothing happens, or update them same value depending on have tweeked @ moment.
<html> <head> <title>chemical room 2</title> </head> <body> <div align="center"> <form method='post' name='update' action='updatecr2.php' /> <?php // connects database mysql_connect("domain.com", "username", "password") or die(mysql_error()); mysql_select_db("chem_inventory") or die(mysql_error()); $data = mysql_query("select * chem_room_2") or die(mysql_error()); print "<table width='90%' border='1' cellspacing='5' cellpadding='10'>"; print "<tr>"; print "<td height='40' colspan='5'><div align='center'>fab 32 litho inventory chem 2</div></td>"; print "<td colspan='2'><div align='center'> </div></td>"; print "<td colspan='4'><div align='center'>cost center: 47860</div></td>"; print "<td width='13%'><div align='center'>00/00/0000</div></td>"; print "</tr>"; print "<tr>"; print "<td width='6%'><div align='center'>case size</div></td>"; print "<td width='6%'><div align='center'>fridge #</div></td>"; print "<td width='6%'><div align='center'>ipn</div></td>"; print "<td width='6%'><div align='center'>wow machine id</div></td>"; print "<td width='6%'><div align='center'>chemical name</div></td>"; print "<td width='6%'><div align='center'>qualified batch #</div></td>"; print "<td width='6%'><div align='center'>expiration date</div></td>"; print "<td width='6%'><div align='center'>stock qty</div></td>"; print "<td width='6%'><div align='center'>current qty</div></td>"; print "<td width='6%'><div align='center'>inventory</div></td>"; print "<td width='27%'><div align='center'>needed qty.</div></td>"; print "<td><div align='center'>comments</div></td>"; print "</tr>"; while($info = mysql_fetch_array( $data )) { print "<tr>"; print "<td align='center'>".$info['case_size'] . "</td> "; print "<td align='center'>".$info['fridge'] . " </td>"; print "<td align='center'>".$info['ipn'] . " </td>"; print "<td align='center'>".$info['wow_machine'] . " </td>"; print "<td align='center'>".$info['chemical'] . " </td>"; print "<td align='center'>".$info['qualified_batch'] . " </td>"; print "<td align='center'>".$info['expiration_date'] . " </td>"; print "<td align='center'>".$info['stock_qty'] . "</td>"; print "<td align='center'><input type='text' size='4' name='current' id=".$info['id'] . " value=".$info['current_qty'] . "> </td>"; print "<td align='center'> </td>"; print "<td align='center'>".$info['needed_qty'] . "</td>"; print "<td align='center'><textarea name='comments'>".$info['comments'] . "</textarea></td>"; print "</tr>"; } print " <td colspan='12'> <div align='center'>items cu wow id's need ordered copper stockroom.</div> </td>"; print "</table>"; ?> <input type="submit" name="submit" value="update" /> </div> </form> </body> </html>
any or point in right direction appreciated have many people depending on update our archaic way of taking inventory.
thank you!
Comments
Post a Comment