Results 1 to 6 of 6

Thread: [RESOLVED] Class 'mysqli' not found in

  1. #1

    Thread Starter
    Frenzied Member StrangerInBeijing's Avatar
    Join Date
    Mar 2005
    Location
    Not in Beijing
    Posts
    1,666

    Resolved [RESOLVED] Class 'mysqli' not found in

    Assume this is sth I need to contact my host for, but they are so cr@ppy, I thought I'd first ask.

    Code is working fine on my local maching, but when running it on my server, I get an error that read:
    Fatal error: Class 'mysqli' not found in /home/httpd/html/www.mysite.com/src/lib/dbconnect.php on line 289
    That line of code:
    $this->MySQLi = new mysqli($servername, $username, $password, $database);
    Install and Configure Eclipse For both Java and PHP development
    Accessible Ajax/jQuery Forms Degrade gracefully with JavaScript Disabled

  2. #2
    Fanatic Member
    Join Date
    Jun 2008
    Posts
    1,023

    Re: Class 'mysqli' not found in

    it doesn't exactly have to be that line, it can be something else? maybe if your server doesn't have the database: $database and just instead a table?

  3. #3
    PowerPoster
    Join Date
    Sep 2003
    Location
    Edmonton, AB, Canada
    Posts
    2,629

    Re: Class 'mysqli' not found in

    run a phpinfo() on your live server and make sure the mysqli extension is installed (open the phpinfo(), and just do a "Find" for "mysqli"). if it isn't, you can ask if they could install it -- or check if PDO is installed instead.

    and no, Justa, if it says the class isn't found, it means the class is not found. PHP doesn't give you random errors that are completely unrelated to the problem. at least, not usually.

  4. #4
    Fanatic Member
    Join Date
    Jun 2008
    Posts
    1,023

    Re: Class 'mysqli' not found in

    well, for me it said error on line 20 once and the error wasnt on that line, it was an error with another variable... thats why i thought maybe it could be something with those variables..

  5. #5
    PowerPoster kfcSmitty's Avatar
    Join Date
    May 2005
    Posts
    2,248

    Re: Class 'mysqli' not found in

    Quote Originally Posted by Justa Lol View Post
    well, for me it said error on line 20 once and the error wasnt on that line, it was an error with another variable... thats why i thought maybe it could be something with those variables..
    Yes, that is the case for some errors. For example if you forget a semicolon or have malformed code it may say a different line simply because the parser is confused by the incorrect code.


    For something like missing dependancies, the error is exactly as it says.

  6. #6

    Thread Starter
    Frenzied Member StrangerInBeijing's Avatar
    Join Date
    Mar 2005
    Location
    Not in Beijing
    Posts
    1,666

    Re: Class 'mysqli' not found in

    Thanks to my cr@ppy host (which I hope to replace soon...they did not even answer my ticket after 3 days now) not having mysqli on the server, I was "forced" to look into PDO kows as suggested. (Yeah, I was lazy!) Works pretty well, and according to some faster than mysql and mysqli. (Dunno...will test it some time to see the speed)
    Install and Configure Eclipse For both Java and PHP development
    Accessible Ajax/jQuery Forms Degrade gracefully with JavaScript Disabled

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width