Re: [PHP] Nested foreach statement

2006-08-03 Thread Richard Lynch
It will probably work, and you could find out for sure by just trying it. It might be better to construct a single query using things like: $company_ids = implode(', ', $_POST['reporton_company']); $query .= WHERE company_id IN ($company_ids) ; This presumes you have already validated the

[PHP] Nested foreach statement

2006-07-31 Thread Chris Grigor
Have been wondering if this is possible Basically I have 3 posted arrays, $_POST['reporton_company'] (this can be various company id's. ie 3,6,7) $_POST['report_period'] (this can be various periods but a max of 4 submitted. ie 3,4,5) $_POST['questions_groups'] (this can be various -

Re: [PHP] Nested foreach statement

2006-07-31 Thread chris smith
foreach($_POST['reporton_company'] as $cmp_ind =$arrayd_cmp_id) { foreach($_POST['report_period'] as $rep_ind =$arrayd_per_id) { foreach($_POST['questions_groups'] as $group_ind = $arrayd_group_no) { mysql_select_db($database_name, $dname); Why