CodeCharge Studio
search Register Login  

Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 checkbox array

Print topic Send  topic

Author Message
wanaka
Posted: 03/15/2004, 5:48 PM

Hi,

I am adding some checkbox for one my record form. Beside the checkbox I have add one button to do custom update in other table for those checkbox that was checked.

I do not how to access the array. The following code generate the following error invalid argument supplied for foreach().

global $server;
foreach($ip_list as $ip_address => $value) {
if ($value == 'Y')
{
}
}
wanaka
Posted: 03/15/2004, 5:57 PM

The input form component is like this
<input type="checkbox" name="ip_list[]" value="10.20.5.2" class="MailboxInput">10.20.5.2
<input type="checkbox" name="ip_list[]" value="10.20.5.5" class="MailboxInput">10.20.5.5
wanaka
Posted: 03/15/2004, 7:55 PM

Hi Now I can get it working but it will only update one record at a time

global $server;
$mycheckbox = $server->ip_list->Value;
foreach($mycheckbox as $key=>$value) {
if($key=='Y')
{
$db = New clsDBeontap();
$SQL = "update ip_address set deviceid=null where ip_address=" . "'" . "$value" ."'";
$SQL2 = "update ip_address set mapping_ip=null where mapping_ip=" . "'" . "$value" ."'";
$db->query($SQL);
$db->query($SQL2);
unset ($db);
}
}

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright 2003-2004 by UltraApps.com  and YesSoftware, Inc.