PHP 5.6 with Mysqli_connect
We recently updated PHP to the latest version and we had a php script running which was now broken.
Currently it doesn't even allow me to connect to the SQL database at all and returns this error: "Failed to connect to MySQL: Can't connect to MySQL server on mysql01.fau.edu (13) 2003".
The database itself is in a linux environment and currently I can't get even a simple script like the one below:
$host = 'mysql01.fau.edu';
$username = '*****';
$password = '*****';
$database = '******';
$connect = mysqli_connect($host,$username,$password,$database);
if (mysqli_connect_errno()) {
echo 'Failed to connect to MySQL: ' . mysqli_connect_error() . mysqli_connect_errno();
} else {
echo 'Connected to MySQL! </ br>';
}
Any help would be greatly appreciated. Thank!
+4
source to share
3 answers
mysqli connect stops working from version 5.5 upwards starting from php 7 updwards it was removed and will give you http ERROR 500 referring to link below
"Call undefined function mysql_connect ()" after upgrading to php-7
0
source to share