Custom Primary Key
Custom Primary Key
Matthew2051
Posts: 13Questions: 1Answers: 0
Hello,
Really struggling to implement the Editor plugin. The MySQL tables I am working with rarely have a primary key name of 'id'. I have been trying to search for a solution with little luck. Played around with the example called browser and altered the MySQL primary key column name to idTest and altered the .js to show the following:
[code]
$(document).ready(function() {
editor = new $.fn.dataTable.Editor( {
"ajaxUrl": "php/browsers.php",
"domTable": "#example",
'srcId': 'idTest',
"fields"...
[/code]
This produces the following alert;
[quote]DataTables warning (table id = 'example'): SQLSTATE[42S22]: Column not found: 1054 Unknown column 'id' in 'field list[/quote]
Any help would be much appreciated. Please bear in mind I am only a novice wishing to use this great tool! Thank you.
Really struggling to implement the Editor plugin. The MySQL tables I am working with rarely have a primary key name of 'id'. I have been trying to search for a solution with little luck. Played around with the example called browser and altered the MySQL primary key column name to idTest and altered the .js to show the following:
[code]
$(document).ready(function() {
editor = new $.fn.dataTable.Editor( {
"ajaxUrl": "php/browsers.php",
"domTable": "#example",
'srcId': 'idTest',
"fields"...
[/code]
This produces the following alert;
[quote]DataTables warning (table id = 'example'): SQLSTATE[42S22]: Column not found: 1054 Unknown column 'id' in 'field list[/quote]
Any help would be much appreciated. Please bear in mind I am only a novice wishing to use this great tool! Thank you.
This discussion has been closed.
Replies
[code]
$(document).ready(function() {
editor = new $.fn.dataTable.Editor( {
"ajaxUrl": "php/browsers.php",
"domTable": "#example",
"idSrc": "idTest",
"fields"
[/code]
Allan