开发者

Connection to my sql data base

开发者 https://www.devze.com 2023-03-28 06:19 出处:网络
First, let me note that the connection infomation is not the correct info. I made a database on 1and1 and I want to connect to it from the web. I am not getting the syntax correct here, can someone po

First, let me note that the connection infomation is not the correct info. I made a database on 1and1 and I want to connect to it from the web. I am not getting the syntax correct here, can someone point me in the right direction?

Here is what I have:

//connect to DB
$dbc=mysql_connect('http://db232154114.db.1and1.com','db232154114','password');

mysql_select_db('tableName',$dbc)

Here are the errors that I am getting:

Warning: mysql_connect() [function.mysql-connect]: php_network_get开发者_开发问答addresses: 
getaddrinfo failed: No such host is known. in 
C:\xampp\htdocs\ciss225Testing\homework\final_process.php on line 35

Warning: mysql_connect() [function.mysql-connect]: [2002] php_network_getaddresses: 
getaddrinfo failed: No such host is kn (trying to connect via tcp://http:3306) in 
C:\xampp\htdocs\ciss225Testing\homework\final_process.php on line 35

Warning: mysql_connect() [function.mysql-connect]: php_network_getaddresses: 
getaddrinfo failed: No such host is known. in 
C:\xampp\htdocs\ciss225Testing\homework\final_process.php on line 35

Warning: mysql_select_db() expects parameter 2 to be resource, boolean given in 
C:\xampp\htdocs\ciss225Testing\homework\final_process.php on line 37


Try to replace http://db232154114.db.1and1.com/ with IP address of SQL server you're connecting to


Remove http:// and enable remote MySQL connections from your server's cPanel or so


your connection string is not right. get rid of the "http://" stuff; that is not part of the db server's hostname.

0

精彩评论

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