! Why can't I connect to the MYSQL database? the table purchased space is in *** .gotoftp3.com, and the database is in myhostadmin.net. Use the PHP pointer to connect to the database. the database on myhostadmin is displayed as the content of conn. php uploaded on the website is as follows:
@ Mysql_connect ("localhost: 3306", "kingdatape", "*******") or die ("mysql link failed ");
@ Mysql_select_db ("php100") or die ("db link failed ");
@ Mysql_query ("set names 'gbk '");
?> Failed to show as DB link. An error occurred while changing the table name nice nice1. If the user name or password is incorrect, the mysql connection fails. I understand that the database cannot be connected to the table. I used navicatformysql to check the database and found that the database tables are normal. I can't figure out where the problem is. please help me.
Reply to discussion (solution)
Mysql_select_db selects a database instead of a table. As shown in the figure, your database should be kingdatape.
@ Mysql_select_db ("php100") or die ("db link failed ");
Change?
@ Mysql_select_db ("kingdatape") or die ("db link failed ");
Then
@ Mysql_connect ("localhost: 3306 ","?? ? Use? Name ","?? ? Password? ") Or die (" mysql link failed ");
Thank you!