RE: [GENERAL] pg_result

From: "Jackson, DeJuan" <djackson(at)cpsgroup(dot)com>
To: Jason <neumeier(at)bright(dot)net>, davez(at)istand(dot)com, pgsql-general(at)postgreSQL(dot)org
Subject: RE: [GENERAL] pg_result
Date: 1998-06-25 17:26:20
Message-ID: F10BB1FAF801D111829B0060971D839F2F90BD@cpsmail
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> $result points to the result structure. I.e.
>
> $result_status = $result->resultStatus
>
> Returns the status of the result. For comparing the status you
> may use one of the following constants depending upon the
> command executed:
>
> - PGRES_EMPTY_QUERY
> - PGRES_COMMAND_OK
> - PGRES_TUPLES_OK
> - PGRES_COPY_OUT
> - PGRES_COPY_IN
> - PGRES_BAD_RESPONSE
> - PGRES_NONFATAL_ERROR
> - PGRES_FATAL_ERROR
>
>
> See Pg.pm for all of the result structure.
>
I believe that you are using PHP, and not PERL, to interface with
PostgreSQL. (Please refer to http://www.php.net)
Since I can't see the query I'll have to assume that the field name that
you are passing to pg_result is wrong. You might want to include the
query and tell us which column you are trying to retrieve.

> > -----Original Message-----
> > From: Jackson, DeJuan [SMTP:djackson(at)cpsgroup(dot)com]
> > Sent: Thursday, June 25, 1998 11:46 AM
> > To: davez(at)istand(dot)com; pgsql-general(at)postgreSQL(dot)org
> > Subject: RE: [GENERAL] pg_result
> >
> > > I have looked all over the site and I can not find good
> > > description for
> > > 'pg_result' I am having this problem. My database and everthing
> is
> > > working fine but when I try to run a query from an html webpage it
> > is
> > > not
> > > working and I believe it is my 'pg_result' command. I have a
> table
> > > with
> > > 5-6 columns of information and I want total records to be
> selected.
> > I
> > > then
> > > reference the call to a variable and call it further in my HTML,
> but
> > > nothing prints up. I have tried naming all the fields where
> 'row1'
> > is
> > > below but it also doesn't work. I am not getting any errors and
> > html
> > > prints back except for any values for '$rows', not even the row1
> > > values
> > > will come back. My query command works fine in psql.
> > > Does anyone see my problem?
> > >
> > > $result = pg_Exec($conn, "$query");
> > > if (!$result);
> > > echo "An error occured inserting information into our
> > > database.\n";
> > > exit;
> > > else;
> > > pg_close ($conn);
> > > endif;
> > > $rows = pg_result($result,0,"row1");
> > >
> > > Thanks in advance,
> > > Dave
> > Close the connection after you are done retrieving the results.
> > -DEJ

Responses

Browse pgsql-general by date

  From Date Subject
Next Message The Hermit Hacker 1998-06-25 18:07:56 Re: a little question
Previous Message Jason 1998-06-25 17:13:38 RE: [GENERAL] pg_result