Welcome Guest ( Log In | Register)



 
Reply to this topicStart new topic
> How Do I Connect To Live Database With Php Script?, while being hosted with ComputingHost
darran
post Mar 17 2008, 09:29 AM
Post #1


Privileged Member
*********

Group: Members
Posts: 660
Joined: 31-August 06
From: Singapore
Member No.: 29,189



I am not new to programming.

I want to create a form to add some values into my tables, the code are all working. But I am not sure what is the URL to connect to my site's database. All along, I have been testing through MAMP, which provides a local copy of mySQL.

Can anyone lend me a hand?

My site's URL is http://limetouch.com/
Go to the top of the page
 
+Quote Post
jlhaslip
post Mar 17 2008, 03:10 PM
Post #2


A computer once beat me at chess, but it was no match for me at kick boxing.
Group Icon

Group: [MODERATOR]
Posts: 3,880
Joined: 24-July 05
From: In Trouble Again... still?
Member No.: 9,787
Spam Patrol



Use 'localhost' and that should be fine.
Database name, User name and password, too, of course.
Go to the top of the page
 
+Quote Post
darran
post Mar 18 2008, 02:26 AM
Post #3


Privileged Member
*********

Group: Members
Posts: 660
Joined: 31-August 06
From: Singapore
Member No.: 29,189



I want to be able to connect to my site's database and not my local one. Does localhost apply to my site's database connection as well?
Go to the top of the page
 
+Quote Post
rvalkass
post Mar 18 2008, 07:14 AM
Post #4


apt-get moo
Group Icon

Group: [MODERATOR]
Posts: 2,054
Joined: 28-May 05
From: Hertfordshire, England
Member No.: 7,593
Spam Patrol



If you upload the files to your hosting account then you need to use localhost as the server name. 'Localhost' simply means 'this computer'. So, if the actual files using the database are on the same computer as the database itself, then the server name is 'localhost'.

However, if you want to keep the files on your machine, but use the Trap17 database, then you need a remote connection. Unfortunately I don't think Trap17 allows them.
Go to the top of the page
 
+Quote Post
sonesay
post Mar 18 2008, 07:15 AM
Post #5


|||[ n00b King ]|||
*********

Group: [HOSTED]
Posts: 642
Joined: 20-June 07
From: Auckland
Member No.: 45,102



The database on your local machine and the one on trap17 are handled separately by their respective servers. Your trap17 account already has a default account setup for you I believe and so does the MySQL database on your local machine. Their user names and access will be different so you should configure your local MySQL to have user name and databases exactly as how you have it in Trap17. This way you can work on one version and upload it to trap17 and it should work fine since both user name and passwords are identical. The only thing you have to do is make sure your database structure stays the same on both servers.

Go to the top of the page
 
+Quote Post
darran
post Mar 18 2008, 07:53 AM
Post #6


Privileged Member
*********

Group: Members
Posts: 660
Joined: 31-August 06
From: Singapore
Member No.: 29,189



I think we have somehow strayed away from my initial question but I appreciate the feedback nonetheless.

So do you mean to say that if I am using the SQL tables and database on my ComputingHost account, I just need to use 'localhost' and there isn't any remote IP address I need to use? All along in my programming assignments, I have been used to connecting remotely to the server. In any case, thanks for letting me in on this minor detail.
Go to the top of the page
 
+Quote Post
sonesay
post Mar 18 2008, 08:07 AM
Post #7


|||[ n00b King ]|||
*********

Group: [HOSTED]
Posts: 642
Joined: 20-June 07
From: Auckland
Member No.: 45,102



Yes because the file site on the server you will use 'localhost' to refer to itself. Trap17 wont allow you to connect remotely ie. running the php file on your machine at home and trying to connect to your trap17 mysql account. Same for your local machine it will only work locally(unless you configure it to accept remote connections which I think is possible but not recommended).
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. Php Guest Online Script(2)
  2. Need Help With My Database(4)
  3. Hosting Account Suspended(2)
  4. Is The Database System Gone Again? [resolved](12)
  5. Phpizabi Social Network Script(1)
  6. Two Lan Ports Problem(2)
  7. Background Image Swap Script(15)
  8. How Long Can A Man Live Without Water?(17)
  9. How Do I Make A Live Chat Using Php?(15)
  10. Could Someone Make A Php Script For Me?(3)
  11. Database Or Pdf(1)
  12. Loaing Script(3)
  13. Why Doesn't This Code Work On Computinghost?(2)
  14. Invite Script..(2)
  15. Watermark Your Image With Simple Php Script(34)
  1. How To Make A View New Post Script?(5)
  2. Database With Mysql++(7)
  3. If You Had 24 Hours To Live..(23)
  4. Halo 3 Xbox Live Ranks(8)
  5. Import From Excel File Into Mysql Database(7)
  6. Html Code Tester. Online Script(15)
  7. Php Quiz Script(20)
  8. New From Microsoft Live Labs....(9)
  9. Mysql Database Size(6)
  10. Free Weather Feed Script(1)
  11. Rove Live(9)
  12. Need Help Installing Dolphin Community Script!(5)
  13. Where do you live?(61)
  14. Site5's "dream Hosting Package"(0)
  15. Guessing Php Script(0)


 



- Lo-Fi Version Time is now: 25th July 2008 - 10:26 AM