server side displaying only when I input something in search
server side displaying only when I input something in search
Hi
First of all great thanks to Allan. I can only say Wow! about DataTables.
I display data with server side processing in php:
[code]session_start();
include('inc/polaczenie.inc');
/* Paging */
$sLimit = "";
if ( isset( $_GET['iDisplayStart'] ) )
{
$sLimit = "LIMIT ".mysql_real_escape_string( $_GET['iDisplayStart'] ).", ".
mysql_real_escape_string( $_GET['iDisplayLength'] ).";";
}
/* Ordering */
if ( isset( $_GET['iSortCol_0'] ) )
{
$sOrder = "ORDER BY ";
for ( $i=0 ; $i
First of all great thanks to Allan. I can only say Wow! about DataTables.
I display data with server side processing in php:
[code]session_start();
include('inc/polaczenie.inc');
/* Paging */
$sLimit = "";
if ( isset( $_GET['iDisplayStart'] ) )
{
$sLimit = "LIMIT ".mysql_real_escape_string( $_GET['iDisplayStart'] ).", ".
mysql_real_escape_string( $_GET['iDisplayLength'] ).";";
}
/* Ordering */
if ( isset( $_GET['iSortCol_0'] ) )
{
$sOrder = "ORDER BY ";
for ( $i=0 ; $i
This discussion has been closed.
Replies
So this works normally, but you only get an error when you add a search query? Is there any chance you are able to provide a link to this so I can see it in action? What is the JSON return when it does error? And also, there is a "//echo $sQuery;" in the code - what is $sQuery when there is an error?
Thanks!
Allan
thx for fast response.
I can't provide link for now cause i work on localhost but if I won't solve it soon I'll put somwhere in the net.
Basicly it shows only thead part with length, paginating and search input and column names. There is no data. If i put for example 'as' in input box it shows all the records with 'as' string in it and shows info that Showing 1 to 3 of 3 entries (filtered from 17 total entries) which is right cause i have 17 records in database.
When i display serverside file it shows me text in validate json format (i checked in validator).
Query works in phpmyadmin and it is:
[code]SELECT SQL_CALC_FOUND_ROWS `Nazwa`,`Opis`,`Imie`,`Nazwisko`,`Imie2`,`Imie3`,`Wiek`,`Zdjecie`,`Data urodzenia`,`jedenasty`,`Testowy kwiecien` FROM dane [/code]
I've checked many things and I may have something wrong with css which is a little bit messy or other js libraries are incompatible. This is what I include:
[code]
google.load("jquery", "1.3.2");
google.load("jqueryui", "1");
[/code]
If you have any other question I'm still here.
Apart from that I'm going to base on your product in some commercial projects and I'm really intrested to cooperate a litle bit more.
Best regards,
PJ
Is that the full query? I guess you have pagination and sorting disabled in that case? But if it is returning what you expect in PhpMyAdmin, then it should be fine... Are you able to include the JSON output from the request with a search (http://datatables.net/contact if you don't want to make it public)? I don't see anything obviously wrong with the code - but there is certainly some issue somewhere... :-)
Regards,
Allan
Allan
if that may help i just put code which I added to server-side script:
[code]
$what= array("\n", "\r");
$with="";
$sOutput = str_replace($what, $with, $sOutput);
[/code]