Cannot login using php/mySQL codes

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?
