Hi,
I’m struggling to INSERT a new row in a fresh database. Using the provided examples on this page:
Environment:
Kirby: 3.9.2
PHP: 8.2.3
Apache Webserver
All is running in Docker containers
Db::update() works great, no problem at all.
Example code:
$bool = Db::update('users', ['first_name' => 'Myname', 'email' => 'my@email.de'], ['id' => 1]);
Db::insert on the other hand doesn’t work at all. “false” is constantly given back.
Example code:
$id = Db::insert('users', ['first_name' => 'Anothername', 'email' => 'another@email.de']);
Since the applied examples are basically exactly as written on the provided page, okay, other field, I do not know where else to search or look.
These two code snippets have been tested with the newest, as of now, 2023-03-21, MariaDB 10 and MySQL 8 Servers. Exact same behaviour with both servers.
Does anybody have a hint what I could be missing? Thank you very much and all the best to everybody here.