Php + PostgreSQL = it Works, but doenst find records

Php + PostgreSQL = it Works, but doenst find records

ThalesPereiraThalesPereira Posts: 6Questions: 0Answers: 0
edited January 2013 in DataTables 1.9
Hello,

I will try to be quick and clean :)

Im using the script provided on this link http://datatables.net/development/server-side/php_postgres

Following, the changes i made on the file:

[code]
/* 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( 'field1', 'field2', 'field3' );

/* Indexed column (used for fast and accurate table cardinality) */
$sIndexColumn = "id";

/* DB table to use */
$sTable = "the_table";

/* Database connection information */
$gaSql['user'] = "thegood";
$gaSql['password'] = "thebad";
$gaSql['db'] = "theugly";
$gaSql['server'] = "thebacon";

[/code]



And.. the output i get is:

[quote] No matching records found [/quote]


Anyone have idea what i could be missing? =)

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    edited January 2013
    Nope :-). I'd suggest echoing out the SQL statement that is built just before it is executed, looking at that and seeing why it might not be working.

    Allan
  • ThalesPereiraThalesPereira Posts: 6Questions: 0Answers: 0
    edited January 2013
    Thank you for the reply Allan :)

    The weird thing is, the output of the server_pg_processing.php file seens ok:

    {"sEcho":0,"iTotalRecords":2,"iTotalDisplayRecords":2,"aaData":[["bacon","salad"],["1","2"]]}

    echoing the sql output also shows me the desired result.
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    > "sEcho":0

    sEcho should never ever be 0. It simply won't work. So I guess that might be part of the issue - looking at the code it shouldn't be 0 there either.

    Can you provide a link to a test case or run the table through the debugger so we have more information available please?

    Allan
  • ThalesPereiraThalesPereira Posts: 6Questions: 0Answers: 0
    Hello again,

    I have the code im using pasted here: http://justpaste.it/datatablehtml

    and the php file to connect is the one that cna be found here : http://www.datatables.net/development/server-side/php_postgres.

    Im not at work right now, but as soon i arrive i will post the debug output.

    Regards
  • dhiekadhieka Posts: 3Questions: 0Answers: 0
    i have that problem too. and when i change "bServerSide": true into "bServerSide": false, data can display perfectly.. but it seem fndraw not working when bserverside false.
This discussion has been closed.