Received: from virtual1.giganet.nl (tarantula.giganet.nl [212.125.143.1]) by postgresql.org (Postfix) with ESMTP id 7AB26475484 for ; Mon, 22 Apr 2002 10:16:16 -0400 (EDT) Received: from artemis.cuci.nl (artemis.cuci.nl [212.125.128.9]) by virtual1.giganet.nl (BuGless_3.01) with ESMTP id g3MEGGF26645 for ; Mon, 22 Apr 2002 16:16:16 +0200 Received: from adlsa (adlsa.cm.cuci.nl [10.1.12.174]) by artemis.cuci.nl (BuGless_3.01) with ESMTP id g3MEG1R0025391 for ; Mon, 22 Apr 2002 16:16:10 +0200 Message-Id: <200204221416.g3MEG1R0025391@artemis.cuci.nl> Received: from Spooler by adlsa (Mercury/32 v3.30) ID MO00042A; 22 Apr 02 16:16:14 +0200 Received: from spooler by arbodienst-limburg.nl (Mercury/32 v3.30); 22 Apr 02 15:44:06 +0200 From: "Jules Alberts" Organization: ARBOdienst Limburg BV To: pgsql-php@postgresql.org Date: Mon, 22 Apr 2002 15:43:48 +0200 MIME-Version: 1.0 Subject: global variable problem Reply-To: jules.alberts@arbodienst-limburg.nl X-mailer: Pegasus Mail for Windows (v4.01) Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Content-description: Mail message body X-Archive-Number: 200204/78 X-Sequence-Number: 1102 hi everybody, i'm making a little testscript that uses adodb to connect via PHP4 to a postgresql 7.2 db. something like this: === file index.php === PConnect('localhost','username', 'password', 'dbname')) { include("show.php"); } ?> === eof ============== === file show.php === Choose a letter\n"; $lett=array(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z); foreach ($lett as $i) { echo "\n\t$i "; } } function listing($range) { global $conn; echo "

Range: ", $range, "

\n"; $rs=$conn->Execute("select * from rolo where name like '$range%'"); } ?> === eof ============== that's all. the idea is that the users clicks a letter, the function listing() is called, and a selection is made. the problem is the visibility of $conn. it's visible in index.php and in start(), but in listing() it's gone!?! the line $rs=$conn->exectute in listing() produces an error "call to a member of a non-object". what am i doing wrong? how do i make $conn visible in listing()? TIA for any pointers / help! -- Jules Alberts