Closed afourteene closed 2 years ago
We checked and there is no problem.
You may need to check how your code is called.
Use log()
https://medoo.in/api/debug, or debugLogging()
https://medoo.in/api/debug to see what queries are executed for the whole project.
In addition to what @catfan wrote above, a unique index on the username
and userid
columns would prevent duplicates.
In addition to what @catfan wrote above, a unique index on the
username
anduserid
columns would prevent duplicates.
I know,it's work when use the unique index but sometimes we wouldn't use unique index.
@amirziaee You can use log()
or debugLogging()
to see what queries are executed. It seems you called the insert()
twice.
Information
Describe the Problem when I use insert method data is entered twice. please check your source .
Detail Code `$database = new Medoo([
]); $data = [ ['username' => 'foo', 'userid' => '654654654'], ['username' => 'foo1', 'userid' => '65460000']
]; $database->insert('users', $data);`