如何使用 GoDaddy 连接数据库?
How to connect a database using GoDaddy?
我正在尝试将数据库连接到网站。我正在使用 GoDaddy,我发现很难在 php.
中输入以下内容
$host = "Where do I find this? Is this a number? Do I put the IP Address: Port Number?";
$dbusername = "Does it contain quotes?" Or is it just the username?;
$dbpassword = "Does it contain quotes?" Or is it just the password;
$dbname = "Does it contain quotes?" Or is it just the database name;
// Create connection
$conn = new mysqli ($host, $dbusername, $dbpassword, $dbname);
我假设端口号就在本地主机旁边。
$host => 指定主机名或 IP 地址(例如:localhost)。
$username => 指定 MySQL 用户名(例如:my_user)。
$password => 指定 MySQL 密码(例如:my_password)。
$dbname : => 指定要使用的默认数据库(例如:my_db)。
所有这些都包含一个带引号的名称。
例如:
$mysqli = new mysqli("localhost","my_user","my_password","my_db");
我正在尝试将数据库连接到网站。我正在使用 GoDaddy,我发现很难在 php.
中输入以下内容$host = "Where do I find this? Is this a number? Do I put the IP Address: Port Number?";
$dbusername = "Does it contain quotes?" Or is it just the username?;
$dbpassword = "Does it contain quotes?" Or is it just the password;
$dbname = "Does it contain quotes?" Or is it just the database name;
// Create connection
$conn = new mysqli ($host, $dbusername, $dbpassword, $dbname);
我假设端口号就在本地主机旁边。
$host => 指定主机名或 IP 地址(例如:localhost)。
$username => 指定 MySQL 用户名(例如:my_user)。
$password => 指定 MySQL 密码(例如:my_password)。
$dbname : => 指定要使用的默认数据库(例如:my_db)。
所有这些都包含一个带引号的名称。
例如:
$mysqli = new mysqli("localhost","my_user","my_password","my_db");