In reality, my project is really a huge one. I am giving a very shortened version of what I need to accomplish so that hopefully somebody can make sense of the basic functionality I'm looking for. Thanks in advance for any help provided!
1.) Let's say that I have 4 tables (table1, table2, table3, table4). All 4 tables share the same exact structure: For Example, table1 ============== prod_id (PRIMARY KEY, AUTO_INCREMENT) prod_1 prod_date (DATE STAMP) ============== 2.) I have an HTML Web page called collectdata.html. On this same Web page, there is a form where I am using checkboxes to collect information to insert into the 4 tables (mentioned above) in a mysql database. The opening form tag is formatted as shown here: <form action="insertdata.php" method="POST"> NOTE: Therefore, when the form on collectdata.html is submitted, the values of the checkboxes that have been "checked" will be passed through the PHP page, insertdata.php. This PHP page will receive, POST, and process the form checkbox values, then store the values in the database. 3.) There are a total of 12 checkboxes in the form which are split into 4 groups. There shall be 3 checkboxes per group with 3 separate checkbox values per group. Each group of checkbox values shall be stored in 4 separate variables. Each separate group of checkbox values shall be inserted into its assigned table. GROUP FIGURE 1-1 Group 1 checkbox values: (Widget 1, Widget 2, Widget 3 = $prod_1) will be stored in table1 --------------------------------------------------------------------- Group 2 checkbox values: (Widget 4, Widget 5, Widget 6 = $prod_2) will be stored in table2 --------------------------------------------------------------------- Group 3 checkbox values: (Widget 7, Widget 8, Widget 9 = $prod_3) will be stored in table3 --------------------------------------------------------------------- Group 4 checkbox values: (Widget 10, Widget 11, Widget 12 = $prod_4) will be stored in table4 4.) The checkboxes and their values are grouped as show below using the format that tells the database that I want to store each separate group of checkboxes into a variable (e.g. Group 1 will be stored in a variable called $prod_1, etc.). Keep in mind that each group of checkboxes has 3 different products (values) that I want to store in each variable (as shown in GROUP FIGURE 1-1 above and in GROUP FIGURE 1-2 below). Here are the groups of checkboxes: --------------------------------------------------------------------- GROUP FIGURE 1-2 [Group 1 Checkboxes] These 3 checkbox values are to be stored in a variable ($prod_1) using an array and inserted into the database table (table1) and into the table1 field (prod_1): <input type="checkbox" name="prod_1[]" value="Widget 1"> <input type="checkbox" name="prod_1[]" value="Widget 2"> <input type="checkbox" name="prod_1[]" value="Widget 3"> Once the checkbox values are stored in a variable and inserted into the database (table1, prod_1), I should be able to look at the record in the database and see that prod_1 contains the values Widget 1, Widget 2, Widget 3. --------------------------------------------------------------------- [Group 2 Checkboxes] These 3 checkbox values are to be stored in a variable ($prod_2) using an array and inserted into the database table (table2) and into the table2 field (prod_2): <input type="checkbox" name="prod_2[]" value="Widget 4"> <input type="checkbox" name="prod_2[]" value="Widget 5"> <input type="checkbox" name="prod_2[]" value="Widget 6"> Once the checkbox values are stored in a variable and inserted into the database (table2, prod_2), I should be able to look at the record in the database and see that prod_2 contains the values Widget 4, Widget 5, Widget 6. --------------------------------------------------------------------- [Group 3 Checkboxes] These 3 checkbox values are to be stored in a variable ($prod_3) and inserted into the database table (table3) and into the table3 field (prod_3): <input type="checkbox" name="prod_3[]" value="Widget 7"> <input type="checkbox" name="prod_3[]" value="Widget 8"> <input type="checkbox" name="prod_3[]" value="Widget 9"> Once the checkbox values are stored in a variable and inserted into the database (table3, prod_3), I should be able to look at the record in the database and see that prod_3 contains the values Widget 7, Widget 8, Widget 9. --------------------------------------------------------------------- [Group 4 Checkboxes] These 3 checkbox values are to be stored in a variable ($prod_4) and inserted into the database table (table4) and into the table4 field (prod_4): <input type="checkbox" name="prod_4[]" value="Widget 10"> <input type="checkbox" name="prod_4[]" value="Widget 11"> <input type="checkbox" name="prod_4[]" value="Widget 12"> Once the checkbox values are stored in a variable and inserted into the database (table4, prod_4), I should be able to look at the record in the database and see that prod_4 contains the values Widget 10, Widget 11, Widget 12. --------------------------------------------------------------------- 5.) Once all the checkbox values are inserted into the database, I want to be able to select (query) the data from all 4 tables simultaneously and group the SELECT FROM query results so that I can display the results in an HTML table on a Web page called results.php. The results displaying in the HTML table should be split into 4 columns where the number of table rows depends on the total number of records found. Are there any takers on this one? I haven't the slightest clue how to pull this one off. I have read tutorials and tried to do this "monster of a project" from what little information has been given. I did see where most of the tutorials contained iformation about using ".implode". The examples were not that good, so of course I got lost in a hurry. I have put several hours into testing methods and trying to find the answer with no success thus far. My job is on the line and my deadline for this project is running out! Any help on this matter is greatly appreciated! Thanks! ------------------------ Yahoo! Groups Sponsor --------------------~--> Most low income households are not online. Help bridge the digital divide today! http://us.click.yahoo.com/I258zB/QnQLAA/TtwFAA/CefplB/TM --------------------------------------------------------------------~-> The php_mysql group is dedicated to learn more about the PHP/MySQL web database possibilities through group learning. Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/php_mysql/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
