Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar Mark Forums Read
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 02-18-2005, 10:44 PM   #1
Steen2
Confirmed User
 
Join Date: Feb 2004
Location: Vancouver, Canada
Posts: 7,662
Easy PHP question - how to NOT use localhost

What do I put in the place of "localhost" if I want to use a database on a seperate server.

The server's IP? The server's DNS?

Thank you.
__________________
ICQ: 2262.73945
Steen2 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-18-2005, 10:52 PM   #2
Steen2
Confirmed User
 
Join Date: Feb 2004
Location: Vancouver, Canada
Posts: 7,662
bump for an answer
__________________
ICQ: 2262.73945
Steen2 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-18-2005, 10:59 PM   #3
labeledas
Registered User
 
Join Date: Oct 2002
Location: Canada EH?
Posts: 74
i usally just put the address http://somehost.server.com i guess ip would work
, but i am pretty sure you have to have permissions on the database setup to allow outside connections
labeledas is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-18-2005, 11:07 PM   #4
broke
Confirmed User
 
Join Date: Aug 2003
Location: Someplace Windy
Posts: 4,501
You use the database hostname or the database host IP.
broke is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-18-2005, 11:15 PM   #5
Steen2
Confirmed User
 
Join Date: Feb 2004
Location: Vancouver, Canada
Posts: 7,662
Does this look right? Because it's not working...

PHP Code:
function mysqlconn() {
 
$user "f***ay_f**";
 
$pass "***";
 
$db "f***y_f****s@64.**.120.**";
 
$newconnect mysql_pconnect(64.**.120.**, $user,$pass);
 
mysql_select_db($db); 
Please note, aterisks just mean that I don't want to divulge any info.

The above gives me a parse error, changing
$newconnect = mysql_pconnect(64.**.120.**, $user,$pass);
to
$newconnect = mysql_pconnect(localhost, $user,$pass);
gives me "Incorrect database name..." but the page still shows.
__________________
ICQ: 2262.73945
Steen2 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-18-2005, 11:20 PM   #6
labeledas
Registered User
 
Join Date: Oct 2002
Location: Canada EH?
Posts: 74
put the ip in quotes
labeledas is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-18-2005, 11:44 PM   #7
Steen2
Confirmed User
 
Join Date: Feb 2004
Location: Vancouver, Canada
Posts: 7,662
Quote:
Originally Posted by labeledas
put the ip in quotes
Quote:
Incorrect database name 'f***y_f*******s@64.**.120.**'
Thx.
__________________
ICQ: 2262.73945
Steen2 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-18-2005, 11:48 PM   #8
labeledas
Registered User
 
Join Date: Oct 2002
Location: Canada EH?
Posts: 74
so that worked or you still having trouble

Last edited by labeledas; 02-18-2005 at 11:50 PM..
labeledas is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-18-2005, 11:54 PM   #9
Steen2
Confirmed User
 
Join Date: Feb 2004
Location: Vancouver, Canada
Posts: 7,662
Quote:
Originally Posted by labeledas
so that worked or you still having trouble
Putting quotes on the
$newconnect = mysql_pconnect("64.**.120.**", $user,$pass);

part gives me the error:

Incorrect database name 'f***y_f*******s@64.**.120.**'
__________________
ICQ: 2262.73945
Steen2 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-18-2005, 11:56 PM   #10
labeledas
Registered User
 
Join Date: Oct 2002
Location: Canada EH?
Posts: 74
cut @64.**.120.** from the dbname
labeledas is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-19-2005, 12:01 AM   #11
Adultnet
Confirmed User
 
Join Date: Sep 2003
Posts: 8,713
In the connection code you can just replace localhost to ip adress but the database you are connecting to should allow remote connections to it. It shold be configed in the mysql side.
__________________


TrafficCashGold Paying Webmasters Since 1996!

Awesome Conversions! Fast Weekly Payments! Over 125 Tours!
Adultnet is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-19-2005, 12:12 AM   #12
Steen2
Confirmed User
 
Join Date: Feb 2004
Location: Vancouver, Canada
Posts: 7,662
Quote:
Originally Posted by Adultnet
In the connection code you can just replace localhost to ip adress but the database you are connecting to should allow remote connections to it. It shold be configed in the mysql side.
Ok, where do I go within PHPmyAdmin to set that up? Allow for remote connections.

Thank you very much.
__________________
ICQ: 2262.73945
Steen2 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-19-2005, 12:17 AM   #13
Steen2
Confirmed User
 
Join Date: Feb 2004
Location: Vancouver, Canada
Posts: 7,662
Do I go into cPanel and under "access hosts" add the IP address of the site that will be accessing?
__________________
ICQ: 2262.73945
Steen2 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-19-2005, 12:40 AM   #14
Steen2
Confirmed User
 
Join Date: Feb 2004
Location: Vancouver, Canada
Posts: 7,662
Now I am getting

Access denied for user: '@localhost' to database 'f***y_f***s'



How do I allow permission?

I added the IP and domain to access host where the DB resides.
__________________
ICQ: 2262.73945
Steen2 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks
Thread Tools



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.