Re: multiple queries using PHP

From: "Bryan White" <bryan(at)arcamax(dot)com>
To: "Kevin Heflin" <kheflin(at)shreve(dot)net>, "PGSQL-General \(E-mail\)" <pgsql-general(at)postgresql(dot)org>
Subject: Re: multiple queries using PHP
Date: 2000-05-01 23:19:14
Message-ID: 020d01bfb3c3$aac009d0$2dd260d1@bryan
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

>
> My original problem began with.. I have a category table
> cat_id (unique id)
> cat_title (category title)
> mastercat (0 indicates a main category, otherwise points to another cat_id
> which indicates this category to be a subcategory)
>
>
>
> I want to select cat_id and cat_title where mastercat=0
> and at the same time would like to know whether these categories have any
> other categories assigned to them via the mastercat.
>
>
>
> I thought possibly my solution would be to select cat_id, cat_title into
> temporary table where mastercat=0
>
> then continue from there somehow.
>
> Which lead me to my next question, which was how could I execute multiple
> queries from within PHP ?

Its been a while since I worked with PHP but to my recolection it works like
all the other interfaces. When you execute a statement it returns an object
that contains the result set. Accessing that result set remains valid until
destroyed even if other results are returned in the interim. If you keep
assinging the result object to the same variable then the assignment
implicitly destroys the previous result object.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Stephan Richter 2000-05-01 23:52:22 PostGres 7.0 RC2
Previous Message Todd J. Turner 2000-05-01 22:41:54 install question