Mysqli class not found

I used mysqli to connect to the database in my application. It worked fine for several days, and suddenly it started showing the following error:

Fatal error: class 'mysqli' not found

The line I used to connect to the database is:

  $link = new mysqli('localhost', 'uname', 'password', 'scripts'); 

Could you tell me what could have gone wrong?

+5
php mysqli
source share
2 answers

Well, you need to install MySQLi before you can use it. You should also include it (if installed) in your php.ini .

You can check if you have this code:

 if (!function_exists('mysqli_init') && !extension_loaded('mysqli')) { echo 'no mysqli :('; } else { echo 'we gots it'; } 

When you have done this and there is still an error, provide us with more detailed information (OS, PHP version, etc.)

+2
source share

You need to enable mysqli extension in php.ini

Just find the extension = php_mysqli.dll or somethig and delete #

+1
source share

All Articles