pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Picard, Cyril <cyril.picard@eads-dsn.com>
To: 'pgsql' <pgsql-sql@postgresql.org>
Subject: maybe Offtopic : PostgreSQL & PHP ?
Date: Wed, 18 Apr 2001 11:33:20 +0200
Message-ID: <B5CDCF382265D311BF33009027A8FE9401E6F3BC@pmrmsg.edsn.com> (raw)

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 !



view thread (6+ messages)  latest in thread

Message-ID: <B5CDCF382265D311BF33009027A8FE9401E6F3BC@pmrmsg.edsn.com>
Permalink:  ../B5CDCF382265D311BF33009027A8FE9401E6F3BC@pmrmsg.edsn.com/
Also on:    postgresql.org/message-id/B5CDCF382265D311BF33009027A8FE9401E6F3BC@pmrmsg.edsn.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: cyril.picard@eads-dsn.com
  Subject: Re: maybe Offtopic : PostgreSQL & PHP ?
  In-Reply-To: <B5CDCF382265D311BF33009027A8FE9401E6F3BC@pmrmsg.edsn.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox