开发者

how to access MySql database of web hosting site

I have created my own web site in PHP. I have member login function also. For login function i have to create a table of member info in the d开发者_如何转开发atabase of web hosting company(my hosting is provided by GoDaddy.com) and then access mySql database.

>> how can I create the table in my hosting server??

my current code is--

<?php 
$host="localhost"; // Host name **??what will be my host??**   
$username=""; // Mysql username  
$password=""; // Mysql password  
$db_name="test"; // Database name  
$tbl_name="members"; // Table name

// Connect to server and select databse. 
mysql_connect("$host", "$username", "$password")or die("cannot connect");  
mysql_select_db("$db_name")or die("cannot select DB");


The hosting provider should give you that information. There is no way for us to know.


To set up a database for your website with GoDaddy.com, you have to:

  1. Log in to your Account Manager.
  2. Click Web Hosting.

Then you can create your MySQL database.

It then takes up to 1 hour for the database to be created.

Once the database is created, you can click Actions and then Details to find more information, such as its host name.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜