Cannot login using php/mySQL codes

Asked By 20 points N/A Posted on -
qa-featured

When I upload my websites to the hosting website that could make my website accessible to the world wide web,

I get some errors.

I am unable to login when using the same credential codes php/mysql that I always use to test my scripts out.

I log it in to my database using a local host.

I think that I need some IP address so that I could replace it.

But I have absolutely no idea on how to fix this problem.

Can you give me some advise?

SHARE
Answered By 0 points N/A #103015

Cannot login using php/mySQL codes

qa-featured

Most of the time, you can find that you forgot to upload the database to the host server. Ensure that the database is uploaded before you can retry.

Another scenario that could lead to the error messages is that when writing the PHP mysql_connect function, you make reference to three most important arguments; server, username and password. On your localhost you use "localhost” as the server name and the username is “root” and a blank password by default.

These arguments are supposed to be changed when you upload the website to the password and username allocated by your host with the server name also changing to the host server address.

If you have not made the changes to the mysql_connect function, you cannot be able to log in using the log in credentials. Contact your host server to give you the details if you do not have them already.

Replace the three arguments, “server”, “username” and “password”, accordingly and you will be able to log in.

Related Questions