I am drawing items from the SQL database and I am trying to use a form to update the SQL database for two fields. After hitting submit, they are redirected to "shop.php?action=inscribed", the values are changed to the DEFAULT set for the SQL fields...
The form ...
- Code: Select all
<!-- BEGIN list_items --> <form name="{list_items.ITEM_ID}" method="post" action="shop.php?action=inscribed"> <input type="text" class="post" name="formname" value="{list_items.INS_NAME}" /> <textarea name="formdesc" rows="4" cols="25" wrap="virtual" style="width:450px;padding:2px" class="post">{list_items.ITEM_INSCRIPTION}</textarea> <input type="text" hidden="hidden" class="post" name="formid" value="{list_items.ITEM_ID}" /> <input type="submit" name="formbutton" value="Inscribe this Item" class="liteoption" /> </form> <!-- END list_items -->
In shop.php ...
- Code: Select all
$sql = "UPDATE " . USER_ITEMS_TABLE . " SET item_inscription = '{$_POST['formdesc']}' AND item_ins_name = '{$_POST['formname']}' WHERE id = '{$_POST['formid']}' ";