I have 2 tables in my db, each of which has a Catergory column.
Categories Table -
id | category_name
1 : basic
2 : midlevel
3 : highlevel
4 : profesional
Product Table -
id | product | category_name
1 : adsl 1G : basic
2 : adls 2G : midlevel
3 : adsl 3G : highlevel
4 : adsl 4G : profesional
When I update * category_name * in a table categories, I would also like to change it in the table Products, but I'm not sure how to do this.
I could not find and answer, because I do not know how to formulate this correctly.
Any help would be appreciated.
What my update.php looks like:
db_update("UPDATE category SET
`category_name` = '".$_POST['category_name']."'
WHERE category_id = '".$id."'");
what should look like: ???
{code here}
Note: "FIXED - I forgot to send my old value to save.php so that $ id never knows what to update."
source
share