Hey i am a newbie in PHP , was trying to access DB with following code
$db = new mysqli('localhost', 'root', 'XXXXXXX', 'YYYYYY');
i get the error Fatal error: Class 'mysqli' not found
i am using PHP Version 5.2.6 and php_mysqli.dll version 5.2.6.6
1. I checked for extension_dir C:\PHP\ext
2. extension=php_mysqli.dll is unset ( i e enabled) and dll is present in ext dir.
one of the forums i came across this code to check if mysqli dll is loaded
if (!function_exists('mysqli_init') && !extension_loaded('mysqli')) {
echo 'We don\'t have mysqli!!!';
} else {
echo 'Phew we have it!';
}
when i run this code i get the message 'We don\'t have mysqli!!!';
restarted Mysql and apache
what am i doing wrong, Suggestions please , appreciate your help guys.
Fatal error: Class 'mysqli' not found
Moderator: General Moderators
- social_experiment
- DevNet Master
- Posts: 2793
- Joined: Sun Feb 15, 2009 11:08 am
- Location: .za
Re: Fatal error: Class 'mysqli' not found
Which result do you get from the code sample below?
Code: Select all
<?php
$dbc = mysqli_connect('you_host', 'your_username', 'your_password');
if ($dbc) { echo 'Connected'; }
else {
echo 'Not connected';
} ?>“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering
Re: Fatal error: Class 'mysqli' not found
this is what i get Fatal error: Call to undefined function mysqli_connect()
[Solved]Re: Fatal error: Class 'mysqli' not found
1. Viewd the dependencies for mysqli via Dependency Walker ( thank you very much ...great tool) libmysql dll was missing ..added the dll to system32 folder .now it works