|
-
Nov 29th, 2009, 06:17 AM
#1
Thread Starter
Frenzied Member
[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);
-
Nov 29th, 2009, 09:20 AM
#2
Fanatic Member
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?
-
Nov 29th, 2009, 11:02 AM
#3
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.
-
Nov 29th, 2009, 12:17 PM
#4
Fanatic Member
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..
-
Nov 29th, 2009, 10:24 PM
#5
Re: Class 'mysqli' not found in
 Originally Posted by Justa Lol
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.
-
Dec 1st, 2009, 09:28 PM
#6
Thread Starter
Frenzied Member
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)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|