赞
踩
Note that the manual is slightly misleading it states :-
"Sets the current active database on the server that's associated with the specified link identifier. Every subsequent call to mysql_query() will be made on the active database."
The 2nd statement is not true or at best unclear.
mysql_query() manual entry actually correctly states it will use the last link opened by mysql_connect() by default.
Thus if you have 2 connections you will need to specify the connection when calling mysql_query or issue the connect again to ensure the 1st database becomes the default, simply using mysql_select_db will not make the 1st database the default for subsequent calls to mysql_query.
Its probably only apparent when the two databases are on different servers.
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。