DataTables warning: JSON data from server could not be parsed.
DataTables warning: JSON data from server could not be parsed.
col.brazier
Posts: 26Questions: 2Answers: 0
Hi,
I am trying server side datatables for the first time. I get the above error, no data are displayed. I do not even know if I am connecting to the db OK.
Here's my page http://www.fobgfc.org/sq2.php
and the relevant (hopefully!) server code is below.
Thanks in advance.
Colin
[code]
$aColumns = array( 'first_name', 'surname', 'tel_mobile', 'p_1sts', 'p_2nds', 'p_3rds', 'p_4ths',
'p_sundays', 'p_young_vets', 'p_senior_vets', 'p_youths', 'p_academy');
/* Indexed column (used for fast and accurate table cardinality) */
$sIndexColumn = "id";
/* DB table to use */
$sTable = "players01";
[/code]
I am trying server side datatables for the first time. I get the above error, no data are displayed. I do not even know if I am connecting to the db OK.
Here's my page http://www.fobgfc.org/sq2.php
and the relevant (hopefully!) server code is below.
Thanks in advance.
Colin
[code]
$aColumns = array( 'first_name', 'surname', 'tel_mobile', 'p_1sts', 'p_2nds', 'p_3rds', 'p_4ths',
'p_sundays', 'p_young_vets', 'p_senior_vets', 'p_youths', 'p_academy');
/* Indexed column (used for fast and accurate table cardinality) */
$sIndexColumn = "id";
/* DB table to use */
$sTable = "players01";
[/code]
This discussion has been closed.
Replies
Thanks for the link - very useful! Looking at the xhr return in firebug, it looks like the only issue is that you have an echo of one of the SQL statements in your code somewhere. Removing that should fix the problem.
Allan
Excellent again, I think I am going to have to give you harder questions.
Col