I am using medoo to handle table operations. And now I cannot debug via error()
function of medoo at http://medoo.in/api/error.
Here is my test table structure:
CREATE TABLE [user] (
[id] INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
[username] NVARCHAR(50) UNIQUE NOT NULL,
[email] NVARCHAR(50) UNIQUE NOT NULL,
[password] VARCHAR(255) NULL,
[displayname] NVARCHAR(255) NULL
)
And the test code snippet:
$db = new medoo([
'database_type' => 'sqlite',
'database_file' => 'db/test.s3db',
]);
$r = $db->insert('user', ['username' => '<existing data in table>', 'email' => '<existing data in table>']);
var_dump($r);
var_dump($db->error());
And I always get the array via $db->error()
:
[0]=> string(5) "00000" [1]=> NULL [2]=> NULL
However, as the columns are set as unique, so it should return error messages. How to fix it? Any hints are appreciated.