Skip site navigation (1) Skip section navigation (2)

Re: Database connection

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: jill(dot)jensen(at)aisn(dot)net
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Database connection
Date: 2003-01-29 07:02:10
Message-ID: 20400.1043823730@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-novice
"Jill Jensen" <jill(dot)jensen(at)aisn(dot)net> writes:
> $host = "localhost";
> $user = "srproject";
> $pass = "56364563";
> $db = "srproject";

> //open a connection to the database server
> $connection = pg_connect ("host=$local host dbname=$srproject
> user=$srproject password=$56364563");

This is surely wrong.

> $connection = pg_connect ("host=$host dbname=$dbuser=$user password=$pass");

This looks reasonable except you need another space:

$connection = pg_connect ("host=$host dbname=$db user=$user password=$pass");

			regards, tom lane

In response to

Responses

pgsql-novice by date

Next:From: eurlixDate: 2003-01-29 09:46:56
Subject: DB corrupted ?
Previous:From: Derek ClarksonDate: 2003-01-29 06:03:23
Subject: Silly Question about varchar(n)

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group