Hi I have two pages, editCategories, and editSubCategories. At this time, I am sending the data (from the form) on two different pages , editCategoriesSave and editSubCategoriesSave using the post method and I am updating record there. I would like to have one page for updating records instead of two, named editRecordsSave where I can loop trough the posted data from any of the pages and make an update. I will of course post the table name trough the form using hidden field, so I can know in which table to make an update. My problem is how to make a loop which will take field names and make an update query on base on posted data. Anyone can post some code example, or link where I can learn how to do this? Regards, Zoreli
If you want to update a query from form post $var = $_POST['myvar']; // make sql connection mysql_query("UPDATE `table` set field='".mysql_real_escape_string($var)."'"); Code (markup):