maybe Offtopic : PostgreSQL & PHP ? - Mailing list pgsql-sql

From Picard, Cyril
Subject maybe Offtopic : PostgreSQL & PHP ?
Date
Msg-id B5CDCF382265D311BF33009027A8FE9401E6F3BC@pmrmsg.edsn.com
Whole thread Raw
Responses Re: maybe Offtopic : PostgreSQL & PHP ?
List pgsql-sql
Hi all, sorry for the maybe offtopic questions, but I did not get any answer
from the PHP ML.

I would like to query a postgresql db with the php language.
Today I wrote a script (connectandquery.php) performing the following : 
- connect to the DB : $conn = pg_Connect("dbname = foo");
- execute the query : $res = pg_Exec($conn,"SELECT * from BAR");


But I would like to write this in two scripts :
- connect.php : $conn = pg_Connect("dbname = foo");
- query.php : $res = pg_Exec($conn,"SELECT * from BAR");

but I don't know how to get the $conn variable (defined in connect.php) in
the script query.php.

Any idea is welcome !


pgsql-sql by date:

Previous
From: Amanda Riera
Date:
Subject: Re: Concatenate fields
Next
From: Sara Cohen
Date:
Subject: Subqueries in select clause