gpt4 book ai didi

php - 无法使用 PHP 连接到数据库

转载 作者:行者123 更新时间:2023-11-29 01:16:44 25 4
gpt4 key购买 nike

<分区>

我无法正确获取此代码:

$connection=mysql_connect(db_server, db_user, db_pass);
if(!$connection)
{
die("Database Connection failed".mysql_error());
}

$db_select=mysql_select_db(db_name,$connection);
if(!$db_select)
{
die("Database Selection failed".mysql_error());
}

当我尝试脚本时,它说:

Parse error: syntax error, unexpected T_DNUMBER in /home/a8592246/public_html/pic/include/connect.php on line 3

如果可能,任何人都可以复制并粘贴具有正确设置的代码吗?

$mysql_host = "mysql16.000webhost.com";
$mysql_database = "a8592246_dbname";
$mysql_user = "a8592246_dbuser";
$mysql_password = "mypassword";

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