thinkphp M数据库无法切换
ringa_lee
ringa_lee 2017-05-16 12:58:13
0
1
380

3.1版本的tp,代码中需要临时切换一个数据库
$a=M('admin_user')->select();
$b=M_O("compony")->select();
$c=M('xx','cc_','mysql://root:root@111.111.111.111/db')->select;
M_O方法就是return 一个类似M('xx','cc_','mysql://root:root@111.111.111.111/db')这样的,但是这样$c返回一个false,貌似连接没发切换到本地来,请问是什么情况呢

ringa_lee
ringa_lee

ringa_lee

reply all(1)
滿天的星座

Look at the log, are you not connected to the database?

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template