Errors

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
aravona
Forum Contributor
Posts: 347
Joined: Sat Jun 13, 2009 3:59 pm
Location: England

Errors

Post by aravona »

Ok I just transfered a site from one server to a new one (It was originally piggybacking off another site now it has its own) and now I'm getting errors. This wouldn't be a big problem but I didn't write the code for this site myself. Can anyone tell me why it worked fine on one site and now isn't working at all? I know its to do with connecting to the database but, like I said I'm not sure why it worked fine now isnt :)

Also I'm not sure, but I think the problems are all because of the first warning?

Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'name'@'localhost' (using password: NO) in /usr/......./www/lib/opencon.php on line 5

Warning: mysql_select_db(): supplied argument is not a valid MySQL-Link resource in /usr/......../www/lib/opencon.php on line 7

Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /usr/........../www/lib/class-functions.php on line 1473

Warning: mysql_fetch_object(): supplied argument is not a valid MySQL result resource in /usr/........../www/lib/class-functions.php on line 1478


PS: I had to remove full locations etc for security reasons - and if its something simple and I'm being dense, its 9am on tuesday morning! :)

EDIT: after some browsing, learnt it could be my username is incorrect, but its the same code as before nothing has changed?
dejvos
Forum Contributor
Posts: 122
Joined: Tue Mar 10, 2009 8:40 am

Re: Errors

Post by dejvos »

You are absolutely true.

Problem should be in configuration of access to a database:

check if you use correct password and user name:

your past config was
user name: name
password - is not used
host: localhost

in these three cases could be an error ... or your DB is simply temporarily or permanently unavailable ;)
aravona
Forum Contributor
Posts: 347
Joined: Sat Jun 13, 2009 3:59 pm
Location: England

Re: Errors

Post by aravona »

Hah, thanks mate! Really needed someone to point out the obvious to me.

Clever git that I am checked the size of the files, which were the same, not the data when I copied it over yesterday evening.

One had blank username and password the other didnt but had an extra line of un-needed code. Thanks again! Next time I think I'll leave connectivity issues til the afternoon, not first thing :)
Post Reply