views:

2451

answers:

4

I am doing a tutorial and getting this error: Fatal error: Class 'MySQLi' not found (LONG URL) on line 8 the code on line 8 is:

$mysqli = new MySQLi($db_server, $db_user, $db_pass, $db_name) or die(mysqli_error());

I saw online someone said to to see if it was turned on in my Phpinfo() but there wasn't anything listed in there under for "mysqli".

Also, I am running PHP Version 5.2.5

Any help would be appreciated. Thanks!

+6  A: 

Sounds like you just need to install MySQLi.

If you think you've done that and still have a problem, please post your operating system and anything else that might help.

Greg
+2  A: 

Seems like problem with your installation.

  • Have you installed MySQLi?
  • Have you activated it in php.ini?

http://www.php.net/manual/en/mysqli.installation.php

vartec
A: 

You can check if the mysqli libraries are present by executing this code:

if (!function_exists('mysqli_init') && !extension_loaded('mysqli')) {
    echo 'We don\'t have mysqli!!!';
} else {
    echo 'Phew we have it!';
}
karim79
A: 

In addition to uncommenting the php_mysqli.ddl extension in php.ini, also uncomment the extension_dir directive in php.ini and specify your location:

extension_dir = "C:\software\php\dist\ext"

This made it work for me.

catawampus