what am I doing wrong - error message?
| From: | Amanda McComb | Date: | Fri, 02 May 2003 20:33:41 +0000 |
| Subject: | what am I doing wrong - error message? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-146196@lists.php.net to get a copy of this message | ||
Ok, I got the last part working great. So I copied the code to use on an
identical form field, but I'm getting the following error:
Warning: Invalid argument supplied for foreach() in
/usr/local/packages/apache-1.3.27/htdocs/amccomb/prodev/customer_form.php
on line 582
Here is the code snippet:
<TD VALIGN=TOP>
Your institution:
</TD>
<TD VALIGN=TOP>
<?$query = "SELECT * FROM org_type_t WHERE retired_flag is NULL OR
retired_flag = 0 ORDER BY org_type_name";
$search_results = mysql_query($query) or die("Select Failed!"); ?>
<?while ($search_result = mysql_fetch_array($search_results)) {?>
<INPUT TYPE="CHECKBOX" NAME="org_type[]" VALUE="<?echo
$search_result['org_type_cd']; ?>"
<?if($notall == 1){?>
<? foreach( $_POST['org_type'] as $org_type_cd => $quantity){
if($quantity) { // if one exists
if ($quantity ==
$search_result['org_type_cd']){?>
CHECKED
<?}
}
}?>
<?}?>
><? echo $search_result['org_type_name'] ?><BR>
<?}?>
</TD>