Creating a new database. |
Just to add that creating tables for the new database is not really straightforward and the code above generates an error when fields and tables are added: "InvalidArgumentException D8 is not a valid database connection group."
It seems that the new database needs an entry in \Config\Databases.php to establish a connection. If I simply put "$this->db->simpleQuery('USE '.$dbName);", then the tables are added without error. Hope this helps anyone seeking to do the same...
~ Dave
|
Messages In This Thread |
Creating a new database. - by davecoventry - 10-10-2022, 12:30 PM
RE: Creating a new database. - by InsiteFX - 10-11-2022, 01:04 AM
RE: Creating a new database. - by davecoventry - 10-11-2022, 02:44 AM
RE: Creating a new database. - by InsiteFX - 10-12-2022, 01:24 AM
RE: Creating a new database. - by davecoventry - 10-12-2022, 06:04 AM
|