Unknown column 'id' in 'field list'' in /var/www/html/table/php/lib/Database/Driver/Mysql/Query.php

Unknown column 'id' in 'field list'' in /var/www/html/table/php/lib/Database/Driver/Mysql/Query.php

jghankinsjghankins Posts: 6Questions: 0Answers: 0
edited March 2013 in Editor
Getting the following error after an initial config using the generator. I have an existing table so I did not use the provided .sql As I have a key field that is different, where can I change the default which is apparently 'id'?

[code]Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[42S22]: Column not found: 1054 Unknown column 'id' in 'field list'' in /var/www/html/table/php/lib/Database/Driver/Mysql/Query.php:98
Stack trace:
#0 /var/www/html/table/php/lib/Database/Driver/Mysql/Query.php(98): PDOStatement->execute()
#1 /var/www/html/table/php/lib/Database/Query.php(530): DataTables\Database\DriverMysqlQuery->_exec()
#2 /var/www/html/table/php/lib/Database/Query.php(194): DataTables\Database\Query->_select()
#3 /var/www/html/table/php/lib/Editor/Editor.php(446): DataTables\Database\Query->exec()
#4 /var/www/html/table/php/lib/Editor/Editor.php(303): DataTables\Editor->_get(NULL, Array)
#5 /var/www/html/table/php/table.user_information.php(72): DataTables\Editor->process(Array)
#6 {main}
thrown in /var/www/html/table/php/lib/Database/Driver/Mysql/Query.php on line 98 [/code]

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    > where can I change the default which is apparently 'id'?

    Using the third parameter of the `Editor` class constructor: http://editor.datatables.net/docs/current/php/class-DataTables.Editor.html#___construct . Simply set it to your pkey name and that should do it.

    Allan
  • jghankinsjghankins Posts: 6Questions: 0Answers: 0
    That did it. Thanks Allan!
This discussion has been closed.