gpt4 book ai didi

php - 如何解决打开流失败的问题?

转载 作者:行者123 更新时间:2023-11-29 20:49:18 25 4
gpt4 key购买 nike

所以我收到此警告,但我不知道如何解决它。它用于将文件连接到我的数据库。

Warning: require(includes/connect.inc.php): failed to open stream: No such file or directory in /customers/5/e/6/gixter.dk/httpd.www/index.php on line 4 Fatal error: require(): Failed opening required 'includes/connect.inc.php' (include_path='.:/usr/share/php') in /customers/5/e/6/gixter.dk/httpd.www/index.php on line 4

我的连接文件如下所示:

<?php
$conn_error = 'Cound not connect to database.';

$mysql_host = 'xxxxx';
$mysql_user = 'xxxxx';
$mysql_pass = 'xxxxx';
$mysql_db = 'xxxxx';

if (!@mysql_connect($mysql_host, $mysql_user, $mysql_pass) or !@mysql_select_db($mysql_db)){
die($conn_error);
}
?>

有人可以帮忙吗?

最佳答案

您指定的路径不正确。该文件不存在或无法在文件夹中找到。它可能处于更高的水平。 (../)

不再支持 mysql 扩展,请查看 mysql_i 扩展或 PDO。 Mysql 已被弃用,并且容易受到 SQL 注入(inject)攻击。

Mysql_i

PDO

关于php - 如何解决打开流失败的问题?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38189716/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com