Error, query failed : Access denied for user 'ODBC'@'localho

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
lmh85
Forum Commoner
Posts: 49
Joined: Sat Oct 28, 2006 10:49 am

Error, query failed : Access denied for user 'ODBC'@'localho

Post by lmh85 »

Error, query failed : Access denied for user 'ODBC'@'localhost' (using password: NO)

gotten this when i tried to do a INSERT..

@mysql_query($sql) or die('Error, query failed : '.mysql_error());

had checked that my$sql statement is correct via mysqlquery..

any one knows 'bout how to get around with it? thanks for any help!!
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

You need

Code: Select all

$db = mysql_connect(.., .., ..) or die(mysql_error());
lmh85
Forum Commoner
Posts: 49
Joined: Sat Oct 28, 2006 10:49 am

Post by lmh85 »

i did have this as include..
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

Then you either haven't included it or there's no or die() statement or you have a mighty strange version of php installed.
wyrmmage
Forum Commoner
Posts: 56
Joined: Sat Oct 28, 2006 12:43 pm
Location: boise, ID

Post by wyrmmage »

could you please post any php code relating to MySQL (or any other databases) that you have before your INSERT statement?
Thanks,
-wyrmmage
User avatar
Cameri
Forum Commoner
Posts: 87
Joined: Tue Apr 12, 2005 4:12 pm
Location: Santo Domingo, Dominican Republic

Post by Cameri »

It seems your connection is using defaults...
First, you have to do like volka said, create a connection link between the PHP page and the MySQL web server.
Make sure the host name, user name and password are set up correctly. And "nevar" create a login with a no password or your database(s) could become compromised.
Post Reply