php、mysql不允许连接到静态函数
我有一个奇怪的问题,对我从我的网络主机那里得到的解决方案不满意 首先,我有一个后台系统,它运行php,直到今天都运行良好。 系统停止向mysql数据库添加一些信息,经过调查,我发现 它没有运行正在调用的静态函数 服务器日志错误: [2013年11月25日13:34:31非洲/约翰内斯堡]PHP警告:mysqli::mysqli()[mysqli.mysqli]:(HY000/1130):不允许主机“197.242.74.19”在第72行的/home/chamdorf/public_html/testsite/libs/config.PHP中连接到此MySQL服务器 [2013年11月25日13:34:31非洲/约翰内斯堡]PHP警告:mysqli::query()[mysqli.query]:无法在第137行的/home/chamdorf/public_html/testsite/rwdsa/catalog/mptt.PHP中获取mysqli [2013年11月25日13:34:31非洲/约翰内斯堡]PHP致命错误:在第139行的/home/chamdorf/public_html/testsite/rwdsa/catalog/mptt.PHP中对非对象调用成员函数fetch_assoc() 有趣的是,这一切都很顺利。 与webhost合作,我们从chamdorfaktrysales.co.za更改了我的连接字符串 到localhost,现在工作正常 由于主机为chamdorfaktrysales.co.za,该网站运行良好,只有在我这样做时才会出现错误: 它是mvc,所以这基本上就是我调用的页面php、mysql不允许连接到静态函数,php,mysql,permissions,Php,Mysql,Permissions,我有一个奇怪的问题,对我从我的网络主机那里得到的解决方案不满意 首先,我有一个后台系统,它运行php,直到今天都运行良好。 系统停止向mysql数据库添加一些信息,经过调查,我发现 它没有运行正在调用的静态函数 服务器日志错误: [2013年11月25日13:34:31非洲/约翰内斯堡]PHP警告:mysqli::mysqli()[mysqli.mysqli]:(HY000/1130):不允许主机“197.242.74.19”在第72行的/home/chamdorf/public_html/te
function rebuild_tree()
{
mptt::rebuild_tree('1',1);
return $this->Data;
}
static function rebuild_tree($parent_id, $left) {
//init and get db connection from self
$a = new mptt();
$db = $a->DBopen;
// the right value of this node is the left value + 1
$right = $left+1;
// get all children of this node
$query_node = $db->query("SELECT CategoryID FROM categories
WHERE ParentID = '$parent_id' ");
while ($row = $query_node->fetch_assoc()) {
// recursive execution of this function for each
// child of this node
// $right is the current right value, which is
// incremented by the rebuild_tree function
$right = mptt::rebuild_tree($row['CategoryID'], $right);
}
// we've got the left value, and now that we've processed
// the children of this node we also know the right value
$db->query("UPDATE categories SET lft='$left', rgt='$right'
WHERE CategoryID='$parent_id' ");
// return the right value of this node + 1
return $right+1;
}
关于这个问题有什么想法吗?
Webhost可能进行了更改?
任何帮助,感谢您的想法,请登录my.cnf如果绑定地址配置正确,此链接可能会有帮助:
它又像以前一样工作了,这是我给他们发电子邮件时网络主持人说的, 我觉得很难相信 我们没有对服务器进行任何更改。您可以看到MySQL根本没有重新启动,相同的版本具有相同的权限
我以前在使用域名作为MySQL主机时遇到过问题,通常的做法是指localhost。我不明白为什么这个方法应该是静态的。但是,此错误应该足够了。
主机“197.242.74.19”不允许连接到此MySQL服务。
您的服务器日志主机“197.242.74.19”不允许连接。
只是指向一个简单的MySQL权限设置。您说,当您将连接更改为localhost
时,它工作正常。那么到底是什么问题呢?嗨,它存储在一个单独的文件中,而不是我当前的文件中view@jszobody,问题是,如果我将站点加载到另一个域,并且需要连接到数据库,该怎么办。我不能用洛卡霍斯特。此外,在系统的其余部分使用chamdorfaktrysales.co.za也可以正常工作,只是在调用静态函数时出现问题