I've been struggling for the last 2 hours to find out why i'm getting this error, but i'm still stuck! I've checked the answers on here but still nothing.
After checking a similar thread I can't seem to find a solution
help would be appreciated
error message:
A PHP Error was encountered
Severity: Notice
Message: Undefined variable: UPGRADES
Filename: views/Test.php
Line Number: 207
Model:
<?php
if(!defined('BASEPATH')) exit('Hacking Attempt: Get out of the system ..!');
class M_live extends CI_Model {
function M_live(){
parent::Model();
function getUpgrades(){
$this->db->select("*");
$this->db->from('client_trust_versions')
$query = $this->db->get();
return $query->result_array();
}
}
}
?>
Controller:
<?php
if(!defined('BASEPATH')) exit('Hacking Attempt: Get out of the system ..!');
class C_Live extends CI_Controller
{
function C_Live(){
parent::__construct();
$this->load->model('M_live');
}
public function index(){
$query = $this->M_live->getUpgrades();
$data['UPGRADES'] = null;
if($query){
$data['UPGRADES'] = $query;
}
$this->load->view('Test', $data);
}
}
?>
View:
<table>
<tr>
<th>ID</th>
<th>Client Name</th>
<th>App Server</th>
<th>Instance Name</th>
<th>BankStaff Server</th>
<th>SQL Server</th>
<th>Instance</th>
<th>Health Roster Version</th>
<th>Employee Online Version</th>
<th>Roster Perform</th>
<th>BankStaff Version</th>
<th>SafeCare Version</th>
<th>E-Expenses</th>
</tr>
<?php foreach((array)$UPGRADES as $upgrades){?>
<tr><td><?php=$upgrade->ID;?></td>
<td><?php=$upgrade->Client_Name;?></td>
<td><?php=$upgrade->App_Server;?></td>
<?php }?>