目前以止,您已经在本地 Web 服务器中开发了一个 Wish List 应用程序,并采用了本地 MySQL 数据库服务器。要让您的应用程序能与远程数据库协作,您需要通过 WishDB 类的变量来更新指定的连接设置。
打开 db.php 文件。
更改 WishDB 类的变量:
var $user = "<the name of the remote database user>";
var $pass = "<the password of the remote database user>";
var $dbName = "<the name of the remote database>";
var $dbHost = "<the account username specified during the hosting account creation>";
在本例中,更新的变量如下所示:
var $user = "phpuser";
var $pass = "!phpuser";
var $dbName = "wishlist";
var $dbHost = "phpuser";