Conversion to msqli
$link = mysql_connect ($host,$user,$pass) or die (); mysql_select_db($db);They changed it to:
$link = mysqli_connect($host, $user, $pass, $db); // Vérification de la connexion if (!$link) { die("Échec de la connexion : " . mysqli_connect_error()); }
I’m getting the error:
Fatal error: Call to undefined function: mysqli_connect()
Why ?? And how to fix it?
- Thanks
7 answers
-
Moderator
response
-
Hello,
Is mysqli installed correctly?
-
I cannot provide a solution in French. Sorry.
-
Moderator
Hello,
Have you checked the active PHP version on your site?
On one of mine I’m at PHP Version 5.6.40, not 8.5, so it depends on the servers. And also on the .htaccess where on Free you can select the version you chose.
In the .htaccess I have an old parameter
# Enable php5 on free.fr (php4 by default)
php 5On a site without the .htaccess I’m at PHP Version 4.4.3-dev. And I tried to set php 8, I stay at 5.
To display the version put a file like info.php containing <?php phpinfo(); ?> and run it manually.
Migration might be in progress. Free has always been very poor at communication. I have 2 sites that are more accessible, neither via FTP nor with a browser.
-
The PHP version of my site on Free 4.4.3.
But I suppose the problem comes from Free. I tested my site on another hosting provider, it works!!!
-
Moderator
We return to the starting questions. Is the document physically uploaded on your site? If so, what is the SQL order error.
-
No. The document is not saved on the site, and no error is raised!
And now nothing else displays except the HTML. Even the links no longer work!