database
database copied to clipboard
A configuration parameter missing in the examples.
I just noticed that the configuration examples in the doc for MySQL are missing the database
-parameter for creating a connection. :)
That shouldn't be a problem - by design the component works across schemas.
Cheers Joe Green
On 15 Mar 2016, at 09:30, Magnus Eriksson [email protected] wrote:
I just noticed that the configuration examples for MySQL are missing the database-parameter when creating a connection. :)
— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/mrjgreen/database/issues/3
Well, it doesn't work for the MySqlConnector.
I was struggling with this issue for little while and didn't get it until I stepped through the code with my debugger. I think it would help a lot to mention it.
You can add the schema in the table()
call: $connection->table('databaseName.tableName')
or like you usually do in the query: $connection->query('SELECT * FROM databaseName.tableName')
. But I agree that this is not well documented, though.
Makes sense, I'll update the docs. However, I do think its good practice to fully qualify table names to avoid ambiguity, and connecting to a "default" schema can sometimes cause confusion.
Its been a while since I've only been dealing with a single schema though, and I understand thats not necessarily the case for everyone.