Malfunction on serverside search ( example given )
Malfunction on serverside search ( example given )

Hey Guys.
the last two years i used Datatables with an textbased database, but I now have switched to a
server-side version of Datatables with an mysql database and I noticed a strange malfunction.
If you try to search for a word beginning with 0 _ % then nothing will happen.
Datatables will not perform a search
At first I thought there is just a mistake in my script, but I noticed that the same problem also occurs
on the official Datatables.net page in this example.
https://datatables.net/examples/data_sources/server_side
If you try it in the next example ( not serverside )
it will work !
https://datatables.net/examples/basic_init/zero_configuration.html
Does anyone have information about this?
What can i do to fix it ?
Thx Samu
Answers
I tried the global sarch with
0 _ %
in the server side example and I can see the server side request sent to the server. Maybe Im' misunderstanding how to replicate the issue.Kevin
Yes i think you misunderstood it.
Open the following Link and sarch this _ Sign
https://datatables.net/examples/basic_init/zero_configuration.html
Then open this Link and try the same
https://datatables.net/examples/data_sources/server_side
It's the same Data in both Tables but not the same search result !
Do you now understand my Problem ?
Samu
I see, you mean to search for
_
. Just the underscore. According to the MySql Pattern Matching docs underscore is a wildcard. The same page mentions using regex searches. You could try that.I don't use the Datatables server side libraries so not sure if the MySql code supports regex searches but if you are using them you might want to try it. Try with the
search()
API and if it works then you can create your own search input or you can create your own event for the default global search like this example:http://live.datatables.net/jorexujo/1/edit
Another option you can try is to escape the _ as shown in this SO thread.
Kevin
Ok,
that explains the behavior for _ and %.
But i have the same problem with 0
What is the explanation for that.
Samu
Searching for
0
is working here:https://datatables.net/examples/data_sources/server_side
Your server side script is responsible for searches. Are you using Datatables provided scripts?
Kevin
Hi Kevin,
this is the PHP part of my test script