MySQLi Not Found During Installation
While following a tutorial, you may encounter the error "Fatal error: Class 'MySQLi' not found" on line 8. This error indicates that the MySQLi extension is not enabled for your PHP installation.
The code on line 8 attempts to create a new MySQLi object using the $mysqli = new MySQLi($db_server, $db_user, $db_pass, $db_name); statement. However, if the MySQLi extension is not installed or enabled, this code will fail.
Solution
To resolve this issue, you need to install the MySQLi extension. You can do this by following these steps:
Once you have installed the MySQLi extension, you should be able to use the MySQLi class without any errors.
The above is the detailed content of Why is My PHP Code Throwing a 'Fatal error: Class 'MySQLi' not found' Error?. For more information, please follow other related articles on the PHP Chinese website!