[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Postgre/PHP installation woes



On 2004-02-24, Danny O'Brien penned:
>
>
> Warning: Supplied argument is not a valid PostgreSQL link resource in 
><path>/auth.php on line 10
>
> Line 10 in auth.php looks like this:
>
> $result = pg_exec( $link, $sql );
>

Well, first of all, from
http://us2.php.net/manual/en/function.pg-query.php :

Note:  This function used to be called pg_exec(). pg_exec() is still
available for compatibility reasons but users are encouraged to use the
newer name.

...

So you should probably tell your client or whatever to use pg_query().

Secondly, what is the value of $link?  That's an awfully strange name
for a variable that should represent the result of a pg_connect() call.

Here's an example of my usage.

$conn = pg_connect ("user=$dbuser password=$dbpasswd dbname=$dbname")
or exit ("<br><br>Unable to connect to database.");

$query = "select blah from foo";

$result = pg_query ($conn, $query);

-- 
monique



Reply to: