Page 1 of 1

Posting a $_POST[multidimensional_array]

Posted: Tue Jan 30, 2007 4:00 am
by josefv
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:

Code: Select all

subcategories[parentCategoryID, Description]
Slightly stuck here...again :?

Posted: Tue Jan 30, 2007 4:19 am
by CoderGoblin
When you say Java do you mean Javascript ?

You may want to have a search on these forums for "chained select"