HOW: Connecting to remote server - SOLVED

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
User avatar
khaki_monster
Forum Commoner
Posts: 73
Joined: Tue Oct 11, 2005 12:36 am
Location: Philippines
Contact:

HOW: Connecting to remote server - SOLVED

Post by khaki_monster »

hello pepz,

how do i connect to my remote server? im using PostgreSQL.

please help..

tanx...
Last edited by khaki_monster on Sat Jul 29, 2006 11:06 am, edited 1 time in total.
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

Code: Select all

$host = 'yourserver.tld';
$db = 'foo';
$user = 'username';
$pass = 'password';

$conn = pg_connect("host=$host dbname=$db user=$user password=$pass")or die(pg_last_error());
User avatar
khaki_monster
Forum Commoner
Posts: 73
Joined: Tue Oct 11, 2005 12:36 am
Location: Philippines
Contact:

Post by khaki_monster »

hi

sorry, i forgot to mention with the use of CURL. so the question here again is, how would i connect to my remote server with the use of CURL.

tanx!
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

cURL isn't intended as a database transport. Are you sure you want to use it as such?
Post Reply