pg.ddx.io  pgsql-php@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jonas Vonlanthen <j.vonlanthen@jef.ch>
To: pgsql-php@postgresql.org
Subject: problems when fetching array contents.
Date: Wed, 13 Aug 2003 19:18:14 +0200
Message-ID: <000001c361be$e1ea8730$2201a8c0@naboo> (raw)

Hello,

I'm having problems fetching array contents.

Connection to my db is alright, the db data too.

Here is the problem:

I have a table named "configuration" containing Keys and Values of
Constants that have to be defined in php.

The code:

$configuration_query = pg_query("select configuration_key as cfgKey,
configuration_value as cfgValue from configuration");

  while ($configuration = tep_db_fetch_array($configuration_query)) {
    echo $configuration['cfgKey']; $configuration['cfgValue'];  // test
    define($configuration['cfgKey'], $configuration['cfgValue']);
  }

The problem I have is that although it passed through the while LOOP the
right number of times (= the number of entries in the table), I'm not
able to print any key or value (when I test using "echo
$configuration['cfgKey']..., it just writes nothing), and the php
constants are therefore not defined.
"configuration_key" and "configuration_value" are varchar(64)

Any one knows how to handle this? I'm using postgre 7.3.2 and php 4.3.1.

Thanks in advance,
Best Regards.

Jonas Vonlanthen




view thread (4+ messages)  latest in thread

Message-ID: <000001c361be$e1ea8730$2201a8c0@naboo>
Permalink:  ../000001c361be$e1ea8730$2201a8c0@naboo/
Also on:    postgresql.org/message-id/000001c361be$e1ea8730$2201a8c0@naboo

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-php@postgresql.org
  Cc: j.vonlanthen@jef.ch
  Subject: Re: problems when fetching array contents.
  In-Reply-To: <000001c361be$e1ea8730$2201a8c0@naboo>
  References: <000001c361be$e1ea8730$2201a8c0@naboo>

* 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