Posting a $_POST[multidimensional_array]
Posted: Tue Jan 30, 2007 4:00 am
In my database, I have two tables: Categories and SubCategories (which references it's parent category via an ID foreign key field)
I want PHP to return all the Categories and SubCategories from the database, and somehow put them inside my html document for Java to process.
A category <select> box and subcategory <select> box exist on the page. I want the content for subcategory to change when the user changes the category, (without re-querying the database)
My only problem is getting an array from PHP which looks something like:
Slightly stuck here...again 
I want PHP to return all the Categories and SubCategories from the database, and somehow put them inside my html document for Java to process.
A category <select> box and subcategory <select> box exist on the page. I want the content for subcategory to change when the user changes the category, (without re-querying the database)
My only problem is getting an array from PHP which looks something like:
Code: Select all
subcategories[parentCategoryID, Description]