Hello,
I have a column in a table that has an IP address (ipaddress) and I'm converting the ip address to a long integer. The conversion is going fine, however, I'm trying to move the data to another column called ip and can't seem to get the form-data array to take it. Here is my code:
I'm sure I'm missing something (probably staring me right in the face but I can't see it).
Thanks for your assistance.
Chris
I have a column in a table that has an IP address (ipaddress) and I'm converting the ip address to a long integer. The conversion is going fine, however, I'm trying to move the data to another column called ip and can't seem to get the form-data array to take it. Here is my code:
<?php
foreach($form->data[vicondb] as $video_net_key)
{
if ($video_net_key['ipaddress'] != null)
{
$iplongvideonet = ip2long(trim($video_net_key['ipaddress']));
$form->data[vicondb]['ip'] = $iplongvideonet;
}
} // End foreach($form->data[vicondb] as $video_net_key)
?>
and the debugger results. Notice that the ip column does not reflect the new value (I have ensured that the change to the long integer is happening and not giving me a 0).
[263] => Array
(
[video_id] => 294
[staff] =>
[manufacturer] => Vicon Industries Inc.
[product_code] =>
[model] =>
[serial_no] =>
[unit_name] =>
[device_name] => 172.26.2.251
[location] =>
[mac] => 00:06:68:02:6D:17
[password] =>
[ip] => 0
[ipaddress] => 172.26.2.251
[subnet] =>
[gateway] =>
[assigned_nvr] =>
)
[264] => Array
(
[video_id] => 375
[staff] =>
[manufacturer] => Vicon Industries Inc.
[product_code] =>
[model] =>
[serial_no] =>
[unit_name] =>
[device_name] => 172.26.2.252
[location] =>
[mac] => 00:06:68:02:6E:DA
[password] =>
[ip] => 0
[ipaddress] => 172.26.2.252
[subnet] =>
[gateway] =>
[assigned_nvr] =>
I'm sure I'm missing something (probably staring me right in the face but I can't see it).
Thanks for your assistance.
Chris