Editor generator error message when generating scripts if table and primary key have the same name
Editor generator error message when generating scripts if table and primary key have the same name
Hello,
I am new with Editor plugin and I have a question.
I have successfully use it with basic initialisation and a simple SQL table with two columns.
So the plugin works great in this case.
I have a table named "param", its primary key is also named "param"
When I try to fill fields on Editor Generator web page and generate scripts I have the following error:
The primary key is automatically included by Editor and is not required in its own field.
And if I use my working example and rename columns name in js and php scripts I have the following error:
**DataTables warning: table id=table-param-detail - Invalid JSON response. For more information about this error, please see http://datatables.net/tn/1**
What is the correct way to use Editor with this SQL table?
Thanks in advance and have a nice day.
This question has an accepted answers - jump to answer
Answers
I've just tried Generator with the configuration shown in the attached screenshot and I don't appear to get that error. Could you show me how you've configured Generator please?
Thanks,
Allan
Hello and thanks for your answer.
I have try with the following configuration:
I will try with another configuration and see if I manage to make it works.
Ok, you are right Allan and the Generator too!
I supposed that the problem come from data in my table.
Can you tell me what characters could make the Ajax request failed?
My table has only 990 lines and contains only two columns.
The primary key (VARCHAR 100)
A column with the value (LONG VARCHAR)
For information, if I add a filter (where clause) the Datatables works like a charm.
Thanks in advance and have a nice day.
Thanks for the screenshot. The problem doesn't come from the fact that the table name and primary key are the same, but rather than the primary key and field 1 are the same, as the error message says. The primary key field should not be included in the field list as that is done automatically.
Allan
Thanks for you answer. You are right again (as usual)! I have read the documentation more precisily and some articles on the forum and I have managed to make it works!
Datatables and Editor are really awesome!