|
|
|
|
![]() ![]() |
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/ |
|
|
|
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: [MODERATOR] Posts: 3,880 Joined: 24-July 05 From: In Trouble Again... still? Member No.: 9,787 ![]() |
Use 'localhost' and that should be fine.
Database name, User name and password, too, of course. |
|
|
|
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?
|
|
|
|
Mar 18 2008, 07:14 AM
Post
#4
|
|
|
apt-get moo ![]() Group: [MODERATOR] Posts: 2,054 Joined: 28-May 05 From: Hertfordshire, England Member No.: 7,593 ![]() |
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. |
|
|
|
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.
|
|
|
|
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. |
|
|
|
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).
|
|
|
|
![]() ![]() |
Similar Topics
|
Lo-Fi Version | Time is now: 25th July 2008 - 10:26 AM |