need help creating an update section

A

Anonymous

Guest
i am working on an administration section. i need help creating an edit/update page where i click the update link on a showproducts.php page, and that link goes to an updateproducts.php page where i can fill out a form on that updateproducts.php page then when i click on the submit button, it updates that product. The information that i would like to update is the category ID, Item ID, Product Item, Item Name, Item Image, Item Description and Item Price.
so far all that i have is just the form, i need help creating the php code for this to work.

is there anyone that can help me out with this, much help would be appreciated.
thanks
 
ok, a little help from me (I'm too busy to write full-details so sorry if I lose you)...

1st: Create your form (the filename will need to be .php)
2nd: Use a select query to retrieve the fields from the record.
3rd: set the 'initial value' of each field in the form to <? echo $variable; ?> (the field from your original record)...
4th: have the form submit to another php page which uses an update query... e.g.
mysql_query("update table set category ID='$catid' where Item ID='$itemid'");
try not to use $_POST within the query, as this can cause annoying problems when starting out - set the variables before... e.g. $catid = $_POST["categoryID"];

and basically your done - I hope that helps a bit. Someone will come along and correct any of my mistakes :D

Andrew
 
Back
Top