datatables parse json error
datatables parse json error
i'm using jquery datatables now , in using that on localhost no problem to use and fetch data from server, but after uploading files on real server that does not working and i get this error:
[code]
DataTables warning (table id = 'showTopics'): DataTables warning: JSON data from server could not be parsed. This is caused by a JSON formatting error.
[/code]
WEBsite:
http://yiifa.ir/shirazee/_modir/contents_managment.php
after trace mysql command on server phpmyadmin, created command in server-side is ok, in firebug that show line 288
MYSQL command :
[code]
SELECT SQL_CALC_FOUND_ROWS c.title, i.id, i.subject, i.date_time, u.name, u.family, i.t_status FROM contents i JOIN categories c ON c.id = i.category JOIN users u ON u.id = i.posted_by WHERE i.post_type = 1 ORDER BY i.order_display
[/code]
tested this command in phpmyadmin is OK.
ERROR is:
[code]
Warning: mysql_fetch_array() expects parameter 1 to be resource, null given in /home/yiifa/public_html/shirazee/_modir/server_processing.php on line 288
{"sEcho":0,"iTotalRecords":"1","iTotalDisplayRecords":"0","aaData":[]}
[/code]
LINE 288:
[code]
/*
* Output
*/
$output = array(
"sEcho" => intval($_GET['sEcho']),
"iTotalRecords" => $iTotal,
"iTotalDisplayRecords" => $iFilteredTotal,
"aaData" => array() // <- line 288
);
[/code]
showTopics :
[code]
oTable_topics =$('#showTopics').dataTable({
"bLengthChange": false,
"bStateSave": false,
"iDisplayLength": 8,
"bScrollCollapse": true,
"bJQueryUI": true,
"bAutoWidth": false,
"sAjaxSource": "server_processing.php",
"sPaginationType": "full_numbers",
"bProcessing": true,
"oLanguage": {
"sEmptyTable" : '<?php _tr('no_topic_seved'); ?>'
},
"fnRowCallback": function( nRow, aData, iDisplayIndex, iDisplayIndexFull ) {
// Bold the grade for all 'A' grade browsers
if ( aData[5] == '1' )
f_buttons = "";
else
f_buttons = "";
f_buttons += "";
f_buttons += "";
$('td:eq(4)', nRow).html( f_buttons );
},
"fnDrawCallback": function(oSettings) {
clickRowHandler_topics();
if ( oSettings.aiDisplay.length == 0 )
{
return;
}
var nTrs = $('tbody tr', oSettings.nTable);
var iColspan = nTrs[0].getElementsByTagName('td').length;
var sLastGroup = "";
for ( var i=0 ; i
[code]
DataTables warning (table id = 'showTopics'): DataTables warning: JSON data from server could not be parsed. This is caused by a JSON formatting error.
[/code]
WEBsite:
http://yiifa.ir/shirazee/_modir/contents_managment.php
after trace mysql command on server phpmyadmin, created command in server-side is ok, in firebug that show line 288
MYSQL command :
[code]
SELECT SQL_CALC_FOUND_ROWS c.title, i.id, i.subject, i.date_time, u.name, u.family, i.t_status FROM contents i JOIN categories c ON c.id = i.category JOIN users u ON u.id = i.posted_by WHERE i.post_type = 1 ORDER BY i.order_display
[/code]
tested this command in phpmyadmin is OK.
ERROR is:
[code]
Warning: mysql_fetch_array() expects parameter 1 to be resource, null given in /home/yiifa/public_html/shirazee/_modir/server_processing.php on line 288
{"sEcho":0,"iTotalRecords":"1","iTotalDisplayRecords":"0","aaData":[]}
[/code]
LINE 288:
[code]
/*
* Output
*/
$output = array(
"sEcho" => intval($_GET['sEcho']),
"iTotalRecords" => $iTotal,
"iTotalDisplayRecords" => $iFilteredTotal,
"aaData" => array() // <- line 288
);
[/code]
showTopics :
[code]
oTable_topics =$('#showTopics').dataTable({
"bLengthChange": false,
"bStateSave": false,
"iDisplayLength": 8,
"bScrollCollapse": true,
"bJQueryUI": true,
"bAutoWidth": false,
"sAjaxSource": "server_processing.php",
"sPaginationType": "full_numbers",
"bProcessing": true,
"oLanguage": {
"sEmptyTable" : '<?php _tr('no_topic_seved'); ?>'
},
"fnRowCallback": function( nRow, aData, iDisplayIndex, iDisplayIndexFull ) {
// Bold the grade for all 'A' grade browsers
if ( aData[5] == '1' )
f_buttons = "";
else
f_buttons = "";
f_buttons += "";
f_buttons += "";
$('td:eq(4)', nRow).html( f_buttons );
},
"fnDrawCallback": function(oSettings) {
clickRowHandler_topics();
if ( oSettings.aiDisplay.length == 0 )
{
return;
}
var nTrs = $('tbody tr', oSettings.nTable);
var iColspan = nTrs[0].getElementsByTagName('td').length;
var sLastGroup = "";
for ( var i=0 ; i
This discussion has been closed.
Replies
Allan
thats all of ok in localhost , thats error is for this which mysql_fetch_array() ???
this error is for datatables
[code]
$output = array(
"sEcho" => intval($_GET['sEcho']),
"iTotalRecords" => $iTotal,
"iTotalDisplayRecords" => $iFilteredTotal,
"aaData" => array()
);
[/code]
my server side file:
http://yiifa.ir/server_processing.txt
Allan