Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
简单的问题,以下命令是否会自动连接到给定的数据库?
R::addDatabase('DB1','sqlite:/tmp/d1.sqlite','user','password',$frozen);
还是等到您真正尝试执行查询?
据我所知,如果您添加数据库,则不会自动建立连接。当您R::selectDatabase('DB1');尝试使用连接时,如果无法建立连接,则会引发错误。不过,您可能已经想通了这一切……
R::selectDatabase('DB1');