says it not connected when it is.

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
User avatar
Sevengraff
Forum Contributor
Posts: 232
Joined: Thu Apr 25, 2002 9:34 pm
Location: California USA
Contact:

says it not connected when it is.

Post by Sevengraff »

Ok, Im making a multi-user blog script (its here) and i am trying to make things a little easier by making a function that would print a specific blog. Now, the function works fine when I test it by itself, but when i use it in a script and then try to do other MySQL querries it gives me the error

Warning: Access denied for user: 'ODBC@127.0.0.1' (Using password: NO) in d:\program files\apache group\apache\htdocs\nlblog\view.php on line 200

Warning: MySQL Connection Failed: Access denied for user: 'ODBC@127.0.0.1' (Using password: NO) in d:\program files\apache group\apache\htdocs\nlblog\view.php on line 200

Warning: MySQL: A link to the server could not be established in d:\program files\apache group\apache\htdocs\nlblog\view.php on line 200
cant get list of comments. 13

when earlier in the script i connected and executed sevearl queries. what could be doing this?
User avatar
nathus
Forum Commoner
Posts: 49
Joined: Thu Dec 12, 2002 6:23 pm

Post by nathus »

do you have a mysql_close anywhere in the code? if so I'd look at that as being the problem.
User avatar
Sevengraff
Forum Contributor
Posts: 232
Joined: Thu Apr 25, 2002 9:34 pm
Location: California USA
Contact:

Post by Sevengraff »

in the function there is a mysql_close, but that's on a different file with its own mysql_connect call. would that affect it?
User avatar
nathus
Forum Commoner
Posts: 49
Joined: Thu Dec 12, 2002 6:23 pm

Post by nathus »

is that file used at all in the script giving you problems? earlier today I misplaced a } in a loop and ended up calling a mysql_close during a loop, which gave me an error message like what you're getting.
User avatar
Sevengraff
Forum Contributor
Posts: 232
Joined: Thu Apr 25, 2002 9:34 pm
Location: California USA
Contact:

Post by Sevengraff »

no, i use that file on every page, it holds all my functoins. but i only get an error when i use it on one page.
User avatar
nathus
Forum Commoner
Posts: 49
Joined: Thu Dec 12, 2002 6:23 pm

Post by nathus »

could you post a bit of the code maybe?

you said the function works fine by itself, but when put in the application, it fails. looked over the error messages again, and it looks like you're trying to do a connect without a password. I do a lot of testing on my local machine, which doesn't have a password on the mysql server, and sometimes forget to change it on the remote site. could this be your problem?
Post Reply