开发者

Connecting to MySQL-database

I'm creating a WWW-page in开发者_如何学Go www.freehostingcloud.com. I created a database of the name sample. But how can I connect to it in MySQL and PHP? I saw from PHP.net that I should type

mysqli = new mysqli('localhost', 'my_user', 'my_password', 'my_db');

OK, so my_db=sample but what are those parameters 'localhost', 'my_user' and 'my_password'?


They are the host, username and password required to access your database. Localhost means your computer aka 127.0.0.1, the others are the users you create in your local db.


They are documented in the Parameters section of mysqli::__construct().

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜