Describe the bug
When I create a database with prefix option in config, the resulting table has a doubled prefix. This happens only at create method. Other methods insert and update work correctly and format a table name with a single prefix.
Information
Version of Medoo: v2.0.0
Type of Database (MySQL, MSSQL, SQLite...): MariaDB 10.5.9
System (Liunx\Windows\Mac): Debian 10
Detail Code
Config example:
new Medoo([
// [required]
'type' => 'mysql',
'socket' => '/var/run/mysqld/mysqld.sock',
'database' => 'c1hbm',
'username' => 'c1hbm',
'password' => 'xxxx',
// [optional]
'charset' => 'utf8mb4',
'collation' => 'utf8mb4_general_ci',
// [optional] Table prefix, all table names will be prefixed as PREFIX_table.
'prefix' => 'HBM_',
// [optional] Enable logging, it is disabled by default for better performance.
'logging' => true,
// [optional]
// Error mode
// Error handling strategies when error is occurred.
// PDO::ERRMODE_SILENT (default) | PDO::ERRMODE_WARNING | PDO::ERRMODE_EXCEPTION
// Read more from https://www.php.net/manual/en/pdo.error-handling.php.
'error' => PDO::ERRMODE_SILENT,
]);
In phpmyadmin I see a table named HBM_HBM_products.
Expected output
I expect to see a table named HBM_products. When I call commands like insert or update - they correctly refer to HBM_products table and as a result lead to error:
Describe the bug When I create a database with prefix option in config, the resulting table has a doubled prefix. This happens only at
create
method. Other methodsinsert
andupdate
work correctly and format a table name with a single prefix.Information
Detail Code Config example:
After I call
In phpmyadmin I see a table named
HBM_HBM_products
.Expected output I expect to see a table named
HBM_products
. When I call commands likeinsert
orupdate
- they correctly refer toHBM_products
table and as a result lead to error: