Fatal error: Call to undefined function mysqli_connect()

For 2 days now I’m trying to solve this, but unfortunately no result. Let me tell you my story about the problem. I’ve bulid an application on a site, and the application deals with the reviews. But, I’m trying to put it on another site, and I copyed the php files, the sql file from the old site, and moved them to the new site (they are on different FTP servers). When I’m trying to go to the pages from the application, I receive this FATAL ERROR:

Fatal error: Call to undefined function mysqli_connect()

The code that I wrote to connect to the database is this (with hidden credentials):

$con = mysqli_connect("","*the_name*","*the_pass*","*the_database*");
if (mysqli_connect_errno()) {
    echo "Failed to connect to MySQL: " . mysqli_connect_error();
}

Why do I get the error? It works on the old server, and the code I think it’s not the problem, because it works on localhost, and on the new server it doesn’t. Can anyone help me?

Leave a Comment