Error Messages

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
sleepydad
Forum Commoner
Posts: 75
Joined: Thu Feb 21, 2008 2:16 pm

Error Messages

Post by sleepydad »

I have signed up with a host that assures me that they are using MySQLi databases and PHP 5.x. My previous host, according to prior posts that I've put in this forum, apparently didn't support either of these. Anyway, I've created a database and uploaded my PHP which tests fine locally on my Mac using MAMP. When I try to access it with this new host on the www, I get the following error messages:

Warning: mysqli::query() [mysqli.query]: Couldn't fetch mysqli in /home/kaseberg/public_html/players.php on line 54

Warning: mysqli::query() [mysqli.query]: Couldn't fetch mysqli in /home/kaseberg/public_html/players.php on line 84

Warning: mysqli::query() [mysqli.query]: Couldn't fetch mysqli in /home/kaseberg/public_html/players.php on line 101

Warning: mysqli::query() [mysqli.query]: Couldn't fetch mysqli in /home/kaseberg/public_html/players.php on line 113

Warning: mysqli::close() [mysqli.close]: Couldn't fetch mysqli in /home/kaseberg/public_html/players.php on line 125

When I view these line numbers in Dreamweaver, all are the same:

Code: Select all

$result=$db->query($query);
I'm using the following to connect to my db:

Code: Select all

@ $db=new mysqli('host', 'uname', 'pass', 'dbName');
** I've omitted my real info here for privacy **

What gives. I'm running out of hair to pull!

Thanks in advance -
sleepydad
User avatar
Darhazer
DevNet Resident
Posts: 1011
Joined: Thu May 14, 2009 3:00 pm
Location: HellCity, Bulgaria

Re: Error Messages

Post by Darhazer »

Remove the @ before the "new mysqli" statement. May be there is an error in the connection and you are suspending that error.
sleepydad
Forum Commoner
Posts: 75
Joined: Thu Feb 21, 2008 2:16 pm

Re: Error Messages

Post by sleepydad »

I removed the "@" and it's working now! I'm not sure why that would be, but I'm back in business.

Thanks!
Post Reply