0

我是 xampp 的初学者,我设置了我的本地主机。我在 linux ubuntu 12.04 上安装 Lampp 并将我的站点文件夹复制到 /opt/lampp/htdocs 中。这个文件夹存在于网络服务器上,它可以工作。现在 Xampp、PHPmyadmin、MySQL 可以在我的电脑上真正工作,我可以在 phpmyadmin 中看到我的表和数据库,我本地主机上的所有内容都是正确的,除非我想加载 index.php网站我看到下面的数据库错误:

A database error occurred while performing the requested procedure. Please review the database error below for more information.
/opt/lampp/htdocs/product/domains/product.behinyab.ir/libs/kohana/libraries/drivers/Database/Mysql.php [368]:
There was an SQL error: No database selected - SELECT `id`, `route` FROM `arag_static_pages` WHERE `appname` = 'arag'

我在谷歌上搜索这个主题并阅读更多内容,但我还不能解决这个问题。任何人都可以解决它?

4

1 回答 1

1

指定您要查询的数据库。您可以通过以下方式在连接或查询中执行此操作:

SELECT database.table.`id`, database.table.`route` FROM database.`arag_static_pages` WHERE database.table.`appname` = 'arag'

实际上就足以提及该表来自哪个数据库,因此在表中添加 db 名称的前缀 from

于 2013-10-22T07:59:46.420 回答