this is a snippet from my code. The problem is that when hit submit all the selected boxes reguardless of which name they are under seem to post the same results. Example if i select:
Instructors = 1
Assistants = 1, 2
Attendees = 1, 2, 3, 4, 5
basic = 3
advanced = 4
expert = 5
it saves as
Instructors = 1, 2, 3, 4, 5
Assistants = 1, 2, 3, 4, 5
Attendees = 1, 2, 3, 4, 5
Basic = 1, 2, 3, 4, 5
Advanced = 1, 2, 3, 4, 5
Expert = 1, 2, 3, 4, 5
[php]elseif($p == “File”) {
if($submit) {
$ml_list = getMemberListing();
$a=0;
$b=0;
$c=0;
$d=0;
$e=0;
$f=0;
foreach($ml_list as $mls) {
$intructors1 .= $$a."[sep]";
$a++;
$assistants1 .= $$b."[sep]";
$b++;
$attendees1 .= $$c."[sep]";
$c++;
$basic1 .= $$d."[sep]";
$d++;
$advanced1 .= $$e."[sep]";
$e++;
$expert1 .= $$f."[sep]";
$f++;
}
$a=0;
$b=0;
$c=0;
$d=0;
$e=0;
$f=0;
$query = “UPDATE {$dbprefix}training SET status = ‘1’, filed = ‘1’, instructors = ‘$instructors1’, assistants = ‘$assistants1’, attendees = ‘$attendees1’, basic = ‘$basic1’, advanced = ‘$advanced1’, expert = ‘$expert1’ WHERE id = ‘$tid’”;
$result = mysql_query($query)
or die(mysql_error());
echo "
Success! |
Report has been filed. You cannot file another report for this training session, update this training session or reuse this training session as it will cause errors in the reports. If you want to remake this training retuen to update training sessions and select Make another with these settings. |
}
elseif(!$submit) {
$query = “SELECT * FROM {$dbprefix}training WHERE id = ‘$tid’”;
$result = mysql_query($query)
or die(mysql_error());
$row = mysql_fetch_array($result);
@extract($row);
$ml = getMemberListing();
$a=0;
$b=0;
$c=0;
$d=0;
$e=0;
$f=0;
foreach($ml as $mem_info) {
$one = “1”;
if($one == “1”) {
$Select_Instructors .= “$mem_info[0]
”;
$Select_Assistants .= “$mem_info[0]
”;
$Select_Attendees .= “$mem_info[0]
”;
$Select_basic .= “$mem_info[0]
”;
$Select_advanced .= “$mem_info[0]
”;
$Select_expert .= “$mem_info[0]
”;
}
$a++;
$b++;
$c++;
$d++;
$e++;
$f++;
}
if($type == “1”) {
echo "
$dispconsolename | |||||||
File a Training Report |
}
}
}[/php]
I know it is something to do with either the section for the checkboxes making them or is it the submit part of making them but i never had to use multiple checkboxes before like this.