Nette 2.3.1 Database bug? LogicException Table ‘client’ does not have a primary key

5 years ago

silviustan
Member | 17
+
+1
-

Hi,

I get this strange error but the table that I try to make a selection has a primary key named id.

The code that I run:

$this->database->table('client')->get(1);

Anybody else that have same problem? Is this a bug or something?

5 years ago

greeny
Member | 406
+
+1
-

Try these steps:

  • clear cache
  • check if given table has primary key
  • check if you are connecting to correct database / host
  • restart apache (or whatever is running your server)

IMHO before you ask anything, try with clearing cache, its sometimes buggy, mainly in database :)

5 years ago

silviustan
Member | 17
+
0
-

Cleared cache and is working. Thanks a lot! Sorry for stupid question :)