Welcome to Dream.In.Code
Become an Expert!

Join 150,102 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,845 people online right now. Registration is fast and FREE... Join Now!




database problem in mysql

 
Reply to this topicStart new topic

database problem in mysql

kaps
4 Jul, 2008 - 10:45 PM
Post #1

New D.I.C Head
*

Joined: 31 May, 2008
Posts: 23

hi frnds,

i have uploaded the mysql database on the remote server, and also i uploaded the my php script but still it is not working, i think the problem is in

CODE
mysql_connect("localhost", "root", "") or die(mysql_error());
mysql_select_db("database") or die(mysql_error());


i think..somthing have to written in place of localhost

pl help me
User is offlineProfile CardPM
+Quote Post

realNoName
RE: Database Problem In Mysql
4 Jul, 2008 - 11:10 PM
Post #2

D.I.C Regular
***

Joined: 4 Dec, 2006
Posts: 311



Thanked: 5 times
My Contributions
if the php script and mysql are on the same server localhost should work if not then you need to replace localhost with the ip/hostname of the mysql server
User is offlineProfile CardPM
+Quote Post

kaps
RE: Database Problem In Mysql
8 Jul, 2008 - 04:25 AM
Post #3

New D.I.C Head
*

Joined: 31 May, 2008
Posts: 23

hi realnoname,

thanx for your advice, but i still unable to find the hostname of webserver..how can one find this...
pl help
User is offlineProfile CardPM
+Quote Post

LockEngel
RE: Database Problem In Mysql
23 Jul, 2008 - 12:29 PM
Post #4

New D.I.C Head
*

Joined: 22 Jul, 2008
Posts: 12



Thanked: 1 times
My Contributions
Are you trying to access it over LAN or WAN?

If you want to access this only inside your LAN then just ping the host computer and grab the IP.

Otherwise if you're running the server locally but want to access it over WAN go to something like http://www.whatismyip.com grab your WAN IP and forward the appropriate ports (if needed).

If the server is being run remotely, what address are you using to add/update your content, or how are you connecting rather?
Use the hostname that you're using there.
For example, connecting to an IP - thats the hostname, connecting to a domain - hostname.
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 1/9/09 12:42AM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month