Posting a $_POST[multidimensional_array]

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
josefv
Forum Newbie
Posts: 23
Joined: Wed Jan 17, 2007 11:17 am

Posting a $_POST[multidimensional_array]

Post 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 :?
User avatar
CoderGoblin
DevNet Resident
Posts: 1425
Joined: Tue Mar 16, 2004 10:03 am
Location: Aachen, Germany

Post by CoderGoblin »

When you say Java do you mean Javascript ?

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