• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Undefined table data

#1
[eluser]selftaught[/eluser]
I am having a hard time finding why my query isn't being displayed:

Below are my MVC components. Any help is greatly appreciated. The output is stating "Undefined table data".

Thank you.

Controller:

class Home extends CI_Controller {

public function index()
{
$data['title'] = "cfs";
$data['heading'] = "My Real Heading";

$this->load->view('header',$data);
$this->load->library('table');

$this->load->model('Golden_txrx_model');

$sql['query'] = $this->Golden_txrx_model->get_broken_txrx();
$this->load->view('query_results',$sql);
}
}


Model:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Golden_txrx_model extends CI_Model {

function __construct()
{
// Call the Model constructor
parent::__construct();
}

function get_broken_txrx()
{
$query = $this->db->query("select ceqface.AASwitch,csno,rfpi,
`txrx_carr1.txdelay[1]`,`txrx_carr1.txdelay[2]`,`txrx_carr1.txdelay[3]`,
`txrx_carr1.rxdelay[1]`,`txrx_carr1.rxdelay[2]`,`txrx_carr1.rxdelay[3]`,`cbrinfo.cbr_type[1]`
from ceqface
left join btseqp
on btsrcs = csno
and btseqp.AASwitch = ceqface.AASwitch
WHERE ceqface.AASwitch IS NOT NULL
and btseqp.`cbrinfo.cbr_type[1]`= '15MHz'
and ceqface.`txrx_carr1.txdelay[1]`!='034.3'
ORDER BY btseqp.AASwitch");
}
}

View:
<body>
<?php echo $this->table->generate($query);?>
</body>
</html>

#2
[eluser]Aken[/eluser]
You aren't returning your query in the model.


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.