Call to undefined function mysqli_connect()
Description
The following code:
<?php
$link=mysqli_connect("localhost","root","root")or die("false to
connect".mysqli_connect_error());
echo ("OK");
?>
Resulted in this output:
Fatal error: Uncaught Error: Call to undefined function mysqli_connect() in E:\connect.php:8 Stack trace: #0 {main} thrown in E:\connect.php on line 8
But I expected this output instead:
OK
PHP Version
PHP 8.1.4
Operating System
Windows 10
You just need to enable the mysqli PHP extension.
您只需要启用 mysqli PHP 扩展。
I have delete the';'before extension=mysqli in php.ini,but didn't succeed.
Check whether phpinfo(); reports that the mysqli extension is loaded.
if not, check the php.ini
Also, make sure you restart your web server. And make sure you are changing the right ini file. There should be one for CLI and one for Apache.
i can't able to ini file!! it saying that you do not have permission