Hi, i tried also this code, copied from this thread:
https://community.x10hosting.com/community/threads/mysql_connect-error.140618/
but i get HTTP ERROR 500.
Please, may you help me?
Thanks in advance
----------------------------------------------------------------------------
<?php
// THIS IS A TEST PHP SCRIPT TO TEST CONNECTING TO YOUR MySQL DATABASE
// DO NOT INCORPORATE INTO YOUR SITE UNTIL YOU HANDLE ERRORS AND 'PASSWORD' TYPE DATA in THE APPROPRIATE WAY
//
// was tested on servers skyy, and bour at x10hosting
//
// Make sure any PHP files have permissions set to 0644 (NOT 0666 or 0777) and subdirectories set to 0755
//
// There is a possibility your .htaccess file can cause problems
// some .htaccess directives that work on other sites do not work on x10Hosting 'free' sites
// cPanel's "IP Deny Manager" on x10Hosting 'free' sites makes the wrong code
//
// Some say x10hosting server boru is haunted.
//
$serverName = "localhost"; // MySQL server name
$user_name = "dzifmwrx_prova02"; // MySQL user name _ do not forget the underscore
$password = "prova02"; // MySQL password
$db_name = "dzifmwrx_prova02"; // MySQL Database name - do not forget the underscore
$tableName = "provatab1"; // MySQL Table name
// try get "MySQL link identifier"
$dbConn = mysql_connect($serverName, $user_name, $password) or die("Cannot connect to server<br />\n MySQL error ==>" . mysql_errno() . "<== : ==>" . mysql_error() . "<== <br />\n");
print "Connected to MySQL server successfully<br />\n";
// try connect to database
mysql_select_db($db_name, $dbConn) or die("Cannot connect to database<br />\n MySQL error ==>" . mysql_errno($dbConn) . "<== : ==>" . mysql_error($dbConn) . "<== <br />\n");
print "Connected to database successfully<br />\n";
// try to get info from table
$query = 'SELECT * FROM ' . $tableName . ' LIMIT 0, 1';
$result = mysql_query($query, $dbConn) or die("Cannot select anything from table<br />\n MySQL error ==>" . mysql_errno($dbConn) . "<== : ==>" . mysql_error($dbConn) . "<== <br />\n");
print "I connected to your server, connected to your database, and received info from your table<br />\n";
?>