Page 1 of 1

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

Posted: Mon Nov 06, 2006 10:38 am
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!!

Posted: Mon Nov 06, 2006 10:44 am
by volka
You need

Code: Select all

$db = mysql_connect(.., .., ..) or die(mysql_error());

Posted: Mon Nov 06, 2006 6:21 pm
by lmh85
i did have this as include..

Posted: Mon Nov 06, 2006 6:51 pm
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.

Posted: Mon Nov 06, 2006 9:49 pm
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

Posted: Mon Nov 06, 2006 10:16 pm
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.