Editor > Generator > id

Editor > Generator > id

nskwortsownskwortsow Posts: 120Questions: 0Answers: 0
edited October 2012 in Editor
Hi,
In my existing DB schema, I don't use the "id" attribute, but a different name for the primary key in my table.
When using the generator, I get a PDO error

Column not found: 1054 Unknown column 'id' in 'field list'' in /Users/xx/Sites/xx/functions/datatables/Database/Driver/Mysql/Query.php:98

How can I circumvent this?

Replies

  • allanallan Posts: 61,451Questions: 1Answers: 10,055 Site admin
    The default is 'id', but this can easily be change using the third parameter of the Editor PHP class: http://editor.datatables.net/docs/current/php/class-DataTables.Editor.html#___construct . Simply set it to the name of your primary key column and that will do it :-).

    Allan
This discussion has been closed.