Page 1 of 1

Fatal error: Class 'mysqli' not found

Posted: Sun Nov 21, 2010 6:09 am
by menues
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.

Re: Fatal error: Class 'mysqli' not found

Posted: Sun Nov 21, 2010 6:57 am
by social_experiment
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';
 } ?>

Re: Fatal error: Class 'mysqli' not found

Posted: Sun Nov 21, 2010 7:28 am
by menues
this is what i get Fatal error: Call to undefined function mysqli_connect()

[Solved]Re: Fatal error: Class 'mysqli' not found

Posted: Sun Nov 21, 2010 11:02 pm
by menues
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