I made a new web-server with the following.
And i have an old web-server which has apache, PHP, and mySQL
The old one is made by almost one click on Window some years ago.
i can do database Connection with old server.
but
i can’t yet do database connection with the new server.
The following is all code in "correct_oldServer.php
$dbServername="localhost";
$dbUsername="root";
$dbPassword="correct";
$dbConnect = mysql_connect($dbServername, $dbUsername, $dbPassword);
If I open correct_oldServer.php with my browser, it shows nothing.
The following is all code in "wrong_oldServer.php
$dbServername="localhost";
$dbUsername="root";
$dbPassword="wrong";
$dbConnect = mysql_connect($dbServername, $dbUsername, $dbPassword);
If I open wrong_oldServer.php with my browser, it shows the below.
if the dbConnection is correct, it shows nothing.
if the dbConnection is NOT correct, it shows Warning like the above.
Let’s make the same pages on the new server and see the results.
The following is all code in "correct_newServer.php
$dbServername="localhost";
$dbUsername="root";
$dbPassword="correct";
$dbConnect = mysql_connect($dbServername, $dbUsername, $dbPassword);
If I open correct_oldServer.php with my brwoser, it shows nothing.
So far, so good
The following is all code in "wrong_newServer.php
$dbServername="localhost";
$dbUsername="root";
$dbPassword="wrong";
$dbConnect = mysql_connect($dbServername, $dbUsername, $dbPassword);
If I open wrong_newServer.php with my brwoser, it also shows nothing.
Both correct_newServer.php and wrong_newServer.php show nothing means that something is wrong in the db connection.
since the php version of the new server is 7.2,
I also tried mysqli_connect instead of mysql_connect.
but the mysqli trial is failed.
What’s wrong with my new server?
something wrong in the linux, apache, PHP, mySQL, or my PHP code?
How can I make the db connection correctly?