Thanks Jason - that's the drop downs working now:
addProduct.php
The last part now is that I'm not sure how to write the selected values into the database table (Products).
The Parent value (categories, category) needs to go into the field Main_Category, and the Child value (subcategories, SubCategory) into 1st_Sub.
The original insert code before the drop downs looked like:
// Add columns
$ins_Products->setTable("Products");
$ins_Products->addColumn("Category_ID", "NUMERIC_TYPE", "POST", "Category_ID");
$ins_Products->addColumn("Main_Category", "STRING_TYPE", "POST", "Main_Category");
$ins_Products->addColumn("Product_Code", "STRING_TYPE", "POST", "Product_Code");
$ins_Products->addColumn("1st_Sub", "STRING_TYPE", "POST", "1st_Sub");
$ins_Products->addColumn("2nd_Sub", "STRING_TYPE", "POST", "2nd_Sub");
$ins_Products->addColumn("Colour", "STRING_TYPE", "POST", "Colour");
$ins_Products->addColumn("Colour_image", "STRING_TYPE", "POST", "Colour_image");
$ins_Products->addColumn("Product_Description", "STRING_TYPE", "POST", "Product_Description");
$ins_Products->addColumn("Price", "DOUBLE_TYPE", "POST", "Price");
$ins_Products->addColumn("Image", "FILE_TYPE", "FILES", "Image");
$ins_Products->setPrimaryKey("Product_ID", "NUMERIC_TYPE");
I tried changing the relevant lines:
$ins_Products->addColumn("Main_Category", "STRING_TYPE", "POST", "Main_Category");
$ins_Products->addColumn("1st_Sub", "STRING_TYPE", "POST", "1st_Sub");
to the fields referenced in the drop downs:
$ins_Products->addColumn("Main_Category", "STRING_TYPE", "POST", "category");
$ins_Products->addColumn("1st_Sub", "STRING_TYPE", "POST", "SubCategory");
but that didn't seem to work.