I already have made a lot of research before coming to ask for help here, but I seriously cannot handle the problem, so here it goes. So, I made my website with Dreamweaver and XAMPP and it's working fine, but I bought online hosting and already put my MySQL database online, and what I would like to do is stay with the website folder in my computer but get the data from database online where it is hosted.
My connection file is this one:
<?php
# FileName="Connection_php_mysql.htm"
# Type="MYSQL"
# HTTP="false"
$hostname_valesilveira = "mysql.hostinger.pt";
$database_valesilveira = "database";
$username_valesilveira = "username";
$password_valesilveira = "password";
$valesilveira = mysql_pconnect($hostname_valesilveira, $username_valesilveira, $password_valesilveira) or trigger_error(mysql_error(),E_USER_ERROR);
?>
If I use the localhost
as hostname it works pretty fine, but I would like to get the data at mysql.hostinger.pt
and it doesn't work, gives this error:
Warning: mysql_pconnect(): in C:\xampp\htdocs\valesilveira\Connections\valesilveira.php on line 9
Warning: mysql_pconnect(): in C:\xampp\htdocs\valesilveira\Connections\valesilveira.php on line 9
Fatal error: php_network_getaddresses: getaddrinfo failed: No such host is known.