Jump to content

[SOLVED] Class 'mysqli' not found in filename...


Conjurer

Recommended Posts

I have had a nice stable little club directory up and running and suddenly one of the forms is no longer working.  Instead when it tries to connect to the database I am getting an error message that the Class 'mysqli' not found in /home/omgma/public_html/Directory/includes/db_fns.php5 on line 6

 

That line in that file is where my database connection script is so somehow it is no longer connecting.  The db connection script is as follows:

function db_connect()
{
    
    $conn = new mysqli("localhost", "username", "password", "database");
    if (mysqli_connect_errno() > 0) 
  {
       $errmsg = "Failure - Could not connect to database with db_connect.<br />mysqli_connect_error message: ".mysqli_connect_error()."<br /><br />"; 
       throw (new Exception($errmsg));
     } 
     else
     {
//    echo "Connection worked! <br>";
     return $conn;
     }	  
} 

 

 

Are there any changes to the mysqli class that might be an issue here? 

Thanks - I also posted a help ticket at the server site and got the following:

PHP, Apache and MySQL was updated to the latest stable release (according to http://forums.xyzhosting.com/showthread.php?t=86495 topic) and some php extensions wasn't enabled automatically by cpanel.

 

Please check all your sites and let us know if you find similar problems.

 

Grrrr... glad it is sorted but wish I had found that out a couple hours earlier!

 

Thanks for your help.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.