[eluser]WanWizard[/eluser]
You're defining local variables, not class variables:
Code:
<?php
class sim_audio_presets extends Controller {
var $table; // add others here as needed
function sim_audio_presets()
{
parent::Controller();
//load libraries and helpers
$this->load->library('user_agent');
$this->load->helper('socket');
$this->load->helper('url');
//Set Database Table
$this->table = 'sim_audio_presets';
//Set callback server
$server = '************';
$port = '****';
}
function get()
{
$id = $this->uri->segment(3);
$this->db->where('room_id', $id);
$query = $this->db->get($this->table);
foreach ($query->result() as $row)
{
$data[] = array('id' => $row->id,
'room_id' => $row->room_id,
'preset' => $row->preset,
'name' => $row->name);
}
$json = '{"'. $table .'":' . json_encode($data) . '}';
$data['json'] = $json;
$this->load->view('responder', $data);
}