Skip site navigation (1) Skip section navigation (2)

Inheritance issues displaying tables

From: pknoob <pknoob(at)noos(dot)fr>
To: pgsql-php(at)postgresql(dot)org
Subject: Inheritance issues displaying tables
Date: 2003-05-31 20:33:54
Message-ID: 200305312233.54808.pknoob@noos.fr (view raw or flat)
Thread:
Lists: pgsql-php
I have three tables that look like this:

CREATE TABLE episodes(
id int, 
 name       text,
 )
);

CREATE TABLE p2p(
  p2p varchar
) INHERITS (episodes);


CREATE TABLE irc(
  server_name varchar
) INHERITS (episodes);

When I try :
$squery="SELECT * FROM episodeirc,episodep2p";
$squery=pg_query($squery);
while($row=pg_fetch_array($squery,NULL,PGSQL_ASSOC))
{
echo "      <td><b><a href=\"\">" . $row["name"] . "</b></td>
 		<td><b><a href=\"\">" . $row["id"] . "</b></td>
		  <td><b><a href=\"\">" . $row["p2p"] . "</b></td>
		  <td><b><a href=\"\">" . $row["server_name"] . "</b></td>";}

the problem is that it  prints results from the episodep2p table only. how can 
I make it print results from both tables?

pgsql-php by date

Next:From: Michael GlaesemannDate: 2003-06-09 08:09:21
Subject: Cleaning up aborted transactions
Previous:From: Bruce YoungDate: 2003-05-31 06:00:24
Subject: Re: DESIGN CONCEPT (performance) - switch/arrays/forms

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group