Unable to connect to SQL vi PHP

Hi

I want to make a logging database where I use a Arduino board to send data to a PHP script that sends data to my SQL database.

I have made a script on called “post.php”, but i cannot manage to connect to my SQL database.

Current error:
php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution

PHP file:



$server = "<https://sql200.epizy.com>>";
$username = "<epiz_33199238>";
$password = "<xxxxxxxxxxxxxxx>";
$database = "<epiz_33199238_temp_logging>";
$table = "<temperatur>";

$connection = mysql_connect($server, $username, $password) or die(mysql_error());
mysql_select_db($database) or die(mysql_error());

Have I used the right login names on server, username etc.???

Thank you

Take note

1 Like

Hi, thank you for your answer. Mut I have my PHP script on my hosted server. It is created with your online file manager. Location of PHP file is on:
http://mydatabase.great-site.net/post.php

I am able to run the file from my web browser. This is tested with having echo “file opened
”;

Do I still need premium account to logon to the SQL from the PHP?

The PHP file recieves data end sends it to SQL.

Should be $server = "sql200.epizy.com";
SQL servers generally run on port 3306 not port 443 (HTTPS). And I don’t know if that greater-than symbol was a mis-type or you have that in your code, but it should be gone as well.

5 Likes

I’m sorry, but that’s not allowed on our hosting, and not going to work either because of this security system:

Please remember: we provide a website hosting service, not a data collection/analytics platform.

Please enter the details displayed in the client area and control panel. There are never any slashes, brackets or colons in any of the values you need to use.

Also, the mysql_* functions were removed from PHP ~8 years ago. Programming languages evolve over time, so only ever follow recent tutorials, not ones from 10+ years ago. Please use MySQLi or PDO instead.

5 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.