I have a table (tb_proxmox) with 2 field (proxmox_id, proxmox_data). My record in field proxmox_data (this dummy record)
{"ip0_proxmox":"31231","ip1_proxmox":"31312313","ip2_proxmox":"","nama_proxmox":"31","port_proxmox":"3131","user_proxmox":"","pwd_proxmox":"","type_proxmox":"","ram_proxmox":"","storage_proxmox":""}
My function in my controller
$data = array(
'ambil_data' => $this->M_proxmox->tampilData('tb_proxmox'),
);
My function in my model (M_proxmox)
public function tampilData($table){
return $this->db->get($table)->result();
}
In my View
<tbody>
<?php
$no = 1;
foreach ($ambil_data as $row) {
$datas = json_decode($row->proxmox_data,true);
foreach($datas as $datum){
?>
<tr>
<td><?php echo $no++ ;?></td>
<td><?php echo $row->proxmox_id; ?></td>
<td><?php echo $datum['ip1_proxmox'];?></td>
<td><a href="#" class="fa fa-pencil"></a><a href="#" class="fa fa-remove"></a></td>
</tr>
</tbody>
<?php
}
}
?>
I got this error Illegal string offset 'ip1_proxmox'