Editor: unable to get the whole table content (filtered content works)
Editor: unable to get the whole table content (filtered content works)
Hello,
I would like to know if there are some limitations or invalid characters in database text field that Editor does not support.
I ask for this because I try to get the whole content of a table and I get the following error message:
DataTables warning: table id=table-param-detail - Invalid JSON response. For more information about this error, please see http://datatables.net/tn/1
My table has only 990 lines and contains only two columns.
The primary key (VARCHAR 100)
A column with the value (LONG VARCHAR)
I supposed that the problem come from data in my table because if I add a filter (where clause) I can get the result (valid json in return) and the Datatables component works perfectly.
Thanks in advance and have a nice day.
This question has accepted answers - jump to:
Answers
Hello again,
After some researches, I have noticed that problem was due to accentuated or utf-8 characters.
What is the way to encoded them or simply tell to Editor component that the database is utf-8?
For more information, I use a Sybase database with an odbc connection (I have writtent the php code from mysql driver code given by Editor component)
Thanks in advance ans have a nice day.
What is the response from the server since it isn't valid JSON? It will likely contain an error message.
Allan
I am not in front of my computer but when I tried to debug Editor php code, the ->json() method which simply do an echo json_encode($this->_out) from my memorie failed to encode the array of records.
I will try to give you more details tomorrow.
Thanks in advance for your help.
I am so stupid sometimes.
I have resolved the "problem" myself by simply adding charset=UTF-8 on the connection string.
Here is what I have done to use Editor with a Sybase / Sql Anywhere database:
$pdo = @new PDO(
"odbc:Driver={SQL Anywhere 10};Server={$host};Database={$db};Uid={$user};Pwd={$pass};LINKS=TCPIP;SERVERNAME={$dsn};charset=UTF-8",
$user,
$pass,
array(
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION
)
);
Thanks for posting back. Good to hear you've got it working now.
Allan