how to access MySql database of web hosting site

£可爱£侵袭症+ 提交于 2019-12-10 19:02:49

问题


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 database 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");

回答1:


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




回答2:


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.



来源:https://stackoverflow.com/questions/2801005/how-to-access-mysql-database-of-web-hosting-site

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!