POST 500 Internal Server Error?
POST 500 Internal Server Error?
Hayezb
Posts: 10Questions: 1Answers: 0
I'm setting up DataTables with CodeIgniter and using the IgnitedTables library. I'm getting a 500 Internal Server Error in my Chrome DevTools. Below is my code, any suggestions?
Controller
[code]
<?php if (!defined('BASEPATH')) die();
class Accounts extends Main_Controller {
public function index(){
if($this->session->userdata('is_logged_in')){
$this->load->view('include/header');
$this->load->view('accounts');
$this->load->view('include/footer');
}else{
redirect('frontpage');
}
}
public function tableload(){
$this->load->library('Datatables');
$this->datatables
->select('ID, ACCOUNTNAME, CONTACTNAME')
->from('LOGISTICS');
echo $this->datatables->generate();
}
}?>
[/code]
Header View - What's between my tags.
[code]
Jaysec Logistics
[/code]
View
[code]
Accounts
$(document).ready(function() {
$('#example').dataTable( {
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "<?php echo base_url('accounts/tableload')?>",
"sServerMethod": "POST"
} );
} );
ID
Account Name
Contact Name
Loading data from server
[/code]
And here is what I'm getting in DevTools
[code]
POST http://logistics-dev:8888/accounts/tableload 500 (Internal Server Error) jquery.js:2
send jquery.js:2
p.extend.ajax jquery.js:2
DataTable.defaults.fnServerData jquery.dataTables.js:8740
_fnAjaxUpdate jquery.dataTables.js:1897
_fnDraw jquery.dataTables.js:1430
_fnFilterComplete jquery.dataTables.js:2184
_fnSort jquery.dataTables.js:4099
_fnInitialise jquery.dataTables.js:2626
(anonymous function) jquery.dataTables.js:6793
p.extend.each jquery.js:2
p.fn.p.each jquery.js:2
DataTable jquery.dataTables.js:6366
(anonymous function) accounts:91
k jquery.js:2
l.fireWith jquery.js:2
p.extend.ready jquery.js:2
D jquery.js:2
[/code]
Controller
[code]
<?php if (!defined('BASEPATH')) die();
class Accounts extends Main_Controller {
public function index(){
if($this->session->userdata('is_logged_in')){
$this->load->view('include/header');
$this->load->view('accounts');
$this->load->view('include/footer');
}else{
redirect('frontpage');
}
}
public function tableload(){
$this->load->library('Datatables');
$this->datatables
->select('ID, ACCOUNTNAME, CONTACTNAME')
->from('LOGISTICS');
echo $this->datatables->generate();
}
}?>
[/code]
Header View - What's between my tags.
[code]
Jaysec Logistics
[/code]
View
[code]
Accounts
$(document).ready(function() {
$('#example').dataTable( {
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "<?php echo base_url('accounts/tableload')?>",
"sServerMethod": "POST"
} );
} );
ID
Account Name
Contact Name
Loading data from server
[/code]
And here is what I'm getting in DevTools
[code]
POST http://logistics-dev:8888/accounts/tableload 500 (Internal Server Error) jquery.js:2
send jquery.js:2
p.extend.ajax jquery.js:2
DataTable.defaults.fnServerData jquery.dataTables.js:8740
_fnAjaxUpdate jquery.dataTables.js:1897
_fnDraw jquery.dataTables.js:1430
_fnFilterComplete jquery.dataTables.js:2184
_fnSort jquery.dataTables.js:4099
_fnInitialise jquery.dataTables.js:2626
(anonymous function) jquery.dataTables.js:6793
p.extend.each jquery.js:2
p.fn.p.each jquery.js:2
DataTable jquery.dataTables.js:6366
(anonymous function) accounts:91
k jquery.js:2
l.fireWith jquery.js:2
p.extend.ready jquery.js:2
D jquery.js:2
[/code]
This discussion has been closed.
Replies
It says that my "logistics.logistics" table does not exist, when I know it does. But why is there a period and name listed twice?
Allan
Presumably "logistics" is the database and "logistics" is the table.
"database.table" is standard syntax.