Home  >  Article  >  Backend Development  >  远程连接mysql查询数据库有关问题

远程连接mysql查询数据库有关问题

WBOY
WBOYOriginal
2016-06-13 11:48:151217browse

远程连接mysql查询数据库问题。
本地有一套php+apache+mysql,查询数据库的时候用 "select * from [表名]"完全没问题。我现在把同样的代码放到一台远程的服务器上,也是php+apache+mysql,可能版本和本地的不一样,但是页面都能打开,唯独数据库读取有问题,必须写成"select * from [数据库名].[表名]"这种形式才可以,有大神知道是为什么吗?我页面涉及查询语句挺多的,不想都给改了,能直接用源代码是最好了。
------解决方案--------------------
检查一下 mysql_select_db() 语句。
------解决方案--------------------
mysql_select_db看看呢。
------解决方案--------------------
检查是否是当前数据库里 执行select * from
------解决方案--------------------
可能数据库没有选对

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn