Ok ill see if i can post this since its a VERY in-depth bunch of code im writing. I really just need to get the basic idea of what my steps would be and the logic of the total process. Also for shortness sake im going to abbreviate Concatonate to concat
I am building an ads listing site. This site has obviously MANY different category's and in those are subcategory's. One of the things im implementing is the ability to have different options for the different subcategory that is chosen. Kind of like eBay and how you get different options when you post a digital camera as opposed to a piece of furniture; you get the idea.
My current process is fairly simple. Once the main page loads (post.php) it auto populates the boxes (country, region, city, category and subcategory) via JS back to the MySQL DB via a logic script(post_logic.php). Then the user is on the hook for filling in the information into the correct <textbox>. I then have it POST it to the next screen (postrev.php); This is where the problems begin.
Since every subcategory has different options then every option has a different ID in the DB and each Option has the subcategory's ID so i have a way to have a relation between the two. Here is a layout of my table.
I hope this is readable.
optID | cat_id | sub_cat_id | sub_option | optOrder | TIMESTAMP
1 | 4 | 26 | Location | 1 | 2009-04-16 15:49:09
2 | 4 | 26 | Time | 2 | 2009-04-16 15:49:09
3 | 4 | 26 | Map Link | 3 | 2009-04-16 15:49:09
When i get to the POSTREV.php page where it inputs the data into the DB i have multiple IDs that change ALL the time depending on what subcategory the user(s) pick. What id like to do is dump all the sub_option and their <textbox> values into a concat'd field in my DB called OPTIONS for that ad listing where i can explode them later having some sort of comma in between all the sets of values. For example, using the DB example up top id like to have
Location: New York, Time: 8am, Map Link: someURL.
How do i go about doing this. I feel like i would need to concat it into a single variable on the main form page then send it over to the DB input page maybe using OnClick function??? but im not REALLY savy on JS and how it all works so i wasnt able to find what i needed.
I know this is LLOOONNG and drawn out, but im at my wits end and this is one of the main things stopping me from launching the site and ive been screwin with this for the past 2-3 weeks with no solution.
Thanks in advance and if i missed something or i need to explain something further please let me know.