json format error
json format error
hello first post here im using thsi wonderfull plugin to use serverside data to my table but i get the error i check whit firebug and i got this results :
( ! ) Notice: Undefined index: sSearch in C:\wamp\www\busqueda.php on line 87
Call Stack
# Time Memory Function Location
1 0.0019 159208 {main}( ) ..\busqueda.php:0
( ! ) Notice: Undefined index: bSearchable_0 in C:\wamp\www\busqueda.php on line 104
Call Stack
# Time Memory Function Location
1 0.0019 159208 {main}( ) ..\busqueda.php:0
( ! ) Notice: Undefined index: bSearchable_1 in C:\wamp\www\busqueda.php on line 104
Call Stack
# Time Memory Function Location
1 0.0019 159208 {main}( ) ..\busqueda.php:0
( ! ) Notice: Undefined index: bSearchable_2 in C:\wamp\www\busqueda.php on line 104
Call Stack
# Time Memory Function Location
1 0.0019 159208 {main}( ) ..\busqueda.php:0
( ! ) Notice: Undefined index: bSearchable_3 in C:\wamp\www\busqueda.php on line 104
Call Stack
# Time Memory Function Location
1 0.0019 159208 {main}( ) ..\busqueda.php:0
( ! ) Notice: Undefined index: bSearchable_4 in C:\wamp\www\busqueda.php on line 104
Call Stack
# Time Memory Function Location
1 0.0019 159208 {main}( ) ..\busqueda.php:0
( ! ) Notice: Undefined index: bSearchable_5 in C:\wamp\www\busqueda.php on line 104
Call Stack
# Time Memory Function Location
1 0.0019 159208 {main}( ) ..\busqueda.php:0
( ! ) Notice: Undefined variable: sOrder in C:\wamp\www\busqueda.php on line 124
Call Stack
# Time Memory Function Location
1 0.0019 159208 {main}( ) ..\busqueda.php:0
( ! ) Notice: Undefined index: sEcho in C:\wamp\www\busqueda.php on line 158
Call Stack
# Time Memory Function Location
1 0.0019 159208 {main}( ) ..\busqueda.php:0
{"sEcho":0,"iTotalRecords":3,"iTotalDisplayRecords":3,"aaData":[["lol ","lololololl","2013-03-21","09:46:35.125","lololll ","20020200"],["jujujuj ","lololooloool","2013-03-21","09:46:51.843","\u00f1lololo ","201010101"],["uuuiuiii ","iuiuiiuiiiuii","2013-03-21","09:47:04.78","iuiuiiiui ","999"]]}
i didnt know you have to change those values since in the postgres example from here on server side data doesnt say anything what can i do to fix this i can see the json has data but i can show it properly, this is what i have on busqueda.php:
<?php
/*
* Script: DataTables server-side script for PHP and PostgreSQL
* Copyright: 2010 - Allan Jardine
* License: GPL v2 or BSD (3-point)
*/
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Easy set variables
*/
/* Array of database columns which should be read and sent back to DataTables. Use a space where
* you want to insert a non-database field (for example a counter or static image)
*/
$aColumns = array( 'usuario', 'ip', 'fecha', 'hora', 'actividad','expediente_afectado' );
/* Indexed column (used for fast and accurate table cardinality) */
$sIndexColumn = "id";
/* DB table to use */
$sTable = "historial";
/* Database connection information */
$gaSql['user'] = "postgres";
$gaSql['password'] = "postgres";
$gaSql['db'] = "postgres";
$gaSql['server'] = "127.0.0.1";
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* If you just want to use the basic configuration for DataTables with PHP server-side, there is
* no need to edit below this line
*/
/*
* DB connection
*/
$gaSql['link'] = pg_connect(
" host=".$gaSql['server'].
" dbname=".$gaSql['db'].
" user=".$gaSql['user'].
" password=".$gaSql['password']
) or die('Could not connect: ' . pg_last_error());
/*
* Paging
*/
$sLimit = "";
if ( isset( $_GET['iDisplayStart'] ) && $_GET['iDisplayLength'] != '-1' )
{
$sLimit = "LIMIT ".intval( $_GET['iDisplayStart'] )." OFFSET ".
intval( $_GET['iDisplayLength'] );
}
/*
* Ordering
*/
if ( isset( $_GET['iSortCol_0'] ) )
{
$sOrder = "ORDER BY ";
for ( $i=0 ; $i $iFilteredTotal,
"aaData" => array()
);
while ( $aRow = pg_fetch_array($rResult, null, PGSQL_ASSOC) )
{
$row = array();
for ( $i=0 ; $i
as you can see i only changed what the example sayed i dont know why i get those undefined variable errors thax in advance and sry for me being a noob at this
o and none of the fields on the db are boolean
( ! ) Notice: Undefined index: sSearch in C:\wamp\www\busqueda.php on line 87
Call Stack
# Time Memory Function Location
1 0.0019 159208 {main}( ) ..\busqueda.php:0
( ! ) Notice: Undefined index: bSearchable_0 in C:\wamp\www\busqueda.php on line 104
Call Stack
# Time Memory Function Location
1 0.0019 159208 {main}( ) ..\busqueda.php:0
( ! ) Notice: Undefined index: bSearchable_1 in C:\wamp\www\busqueda.php on line 104
Call Stack
# Time Memory Function Location
1 0.0019 159208 {main}( ) ..\busqueda.php:0
( ! ) Notice: Undefined index: bSearchable_2 in C:\wamp\www\busqueda.php on line 104
Call Stack
# Time Memory Function Location
1 0.0019 159208 {main}( ) ..\busqueda.php:0
( ! ) Notice: Undefined index: bSearchable_3 in C:\wamp\www\busqueda.php on line 104
Call Stack
# Time Memory Function Location
1 0.0019 159208 {main}( ) ..\busqueda.php:0
( ! ) Notice: Undefined index: bSearchable_4 in C:\wamp\www\busqueda.php on line 104
Call Stack
# Time Memory Function Location
1 0.0019 159208 {main}( ) ..\busqueda.php:0
( ! ) Notice: Undefined index: bSearchable_5 in C:\wamp\www\busqueda.php on line 104
Call Stack
# Time Memory Function Location
1 0.0019 159208 {main}( ) ..\busqueda.php:0
( ! ) Notice: Undefined variable: sOrder in C:\wamp\www\busqueda.php on line 124
Call Stack
# Time Memory Function Location
1 0.0019 159208 {main}( ) ..\busqueda.php:0
( ! ) Notice: Undefined index: sEcho in C:\wamp\www\busqueda.php on line 158
Call Stack
# Time Memory Function Location
1 0.0019 159208 {main}( ) ..\busqueda.php:0
{"sEcho":0,"iTotalRecords":3,"iTotalDisplayRecords":3,"aaData":[["lol ","lololololl","2013-03-21","09:46:35.125","lololll ","20020200"],["jujujuj ","lololooloool","2013-03-21","09:46:51.843","\u00f1lololo ","201010101"],["uuuiuiii ","iuiuiiuiiiuii","2013-03-21","09:47:04.78","iuiuiiiui ","999"]]}
i didnt know you have to change those values since in the postgres example from here on server side data doesnt say anything what can i do to fix this i can see the json has data but i can show it properly, this is what i have on busqueda.php:
<?php
/*
* Script: DataTables server-side script for PHP and PostgreSQL
* Copyright: 2010 - Allan Jardine
* License: GPL v2 or BSD (3-point)
*/
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Easy set variables
*/
/* Array of database columns which should be read and sent back to DataTables. Use a space where
* you want to insert a non-database field (for example a counter or static image)
*/
$aColumns = array( 'usuario', 'ip', 'fecha', 'hora', 'actividad','expediente_afectado' );
/* Indexed column (used for fast and accurate table cardinality) */
$sIndexColumn = "id";
/* DB table to use */
$sTable = "historial";
/* Database connection information */
$gaSql['user'] = "postgres";
$gaSql['password'] = "postgres";
$gaSql['db'] = "postgres";
$gaSql['server'] = "127.0.0.1";
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* If you just want to use the basic configuration for DataTables with PHP server-side, there is
* no need to edit below this line
*/
/*
* DB connection
*/
$gaSql['link'] = pg_connect(
" host=".$gaSql['server'].
" dbname=".$gaSql['db'].
" user=".$gaSql['user'].
" password=".$gaSql['password']
) or die('Could not connect: ' . pg_last_error());
/*
* Paging
*/
$sLimit = "";
if ( isset( $_GET['iDisplayStart'] ) && $_GET['iDisplayLength'] != '-1' )
{
$sLimit = "LIMIT ".intval( $_GET['iDisplayStart'] )." OFFSET ".
intval( $_GET['iDisplayLength'] );
}
/*
* Ordering
*/
if ( isset( $_GET['iSortCol_0'] ) )
{
$sOrder = "ORDER BY ";
for ( $i=0 ; $i $iFilteredTotal,
"aaData" => array()
);
while ( $aRow = pg_fetch_array($rResult, null, PGSQL_ASSOC) )
{
$row = array();
for ( $i=0 ; $i
as you can see i only changed what the example sayed i dont know why i get those undefined variable errors thax in advance and sry for me being a noob at this
o and none of the fields on the db are boolean
This discussion has been closed.
Replies
Allan