[thelist] Re: Looping through the results of a one-to-many-to-many query with PHP

NanHarbisonSmith at aol.com NanHarbisonSmith at aol.com
Mon Feb 18 10:42:00 CST 2002


--
[ Picked text/plain from multipart/alternative ]
Hi John,
I would have to see your code, but it sounds like what you are doing is a
join of the tables without specifying the where clause correctly, or you are
not choosing a unique result set:
select unique firstthing, secondthing, thirdthing
from table1, table2
where table1.id = table2.id

<please note> I have not put all the proper single and double quotes, this is
pseudocode</please note>

Nan

> ----original message --------
> From: "john corry" <john at neoncowboy.com>
> To: <thelist at lists.evolt.org>
> Date: Sat, 16 Feb 2002 14:58:16 -1000
> Subject: [thelist] Looping through the results of a one - to - many - to -
> many query with PHP
> Reply-To: thelist at lists.evolt.org
>
> Hi Y'all,
>
> I'm kind of confused. I have a query that requests rows from three
> tables...When the results come back, I get 9 rows returned..Like this:
>
> Kihei Surfside, Kihei Surfside is an excellent property for beach ...,
> kihei_surfside_ext.jpg, 3 ,135.00 ,110.00 ,125.00 ,135.00
> Kihei Surfside, Kihei Surfside is an excellent property for beach ...,
> kihei_surfside_ext.jpg, 6 ,150.00 ,120.00 ,140.00 ,150.00
> Kihei Surfside, Kihei Surfside is an excellent property for beach ...,
> kihei_surfside_ext.jpg, ,10 ,205.00 ,165.00 ,190.00 ,205.00
>
> Kihei Surfside, Kihei Surfside is an excellent property for beach ...,
> kihei_surfside_ext_small.jpg, 3 ,135.00 ,110.00 ,125.00 ,135.00
> Kihei Surfside, Kihei Surfside is an excellent property for beach ...,
> kihei_surfside_ext_small.jpg, 6 ,150.00 ,120.00 ,140.00 ,150.00
> Kihei Surfside, Kihei Surfside is an excellent property for beach ...,
> kihei_surfside_ext_small.jpg, ,10 ,205.00 ,165.00 ,190.00 ,205.00
>
> Kihei Surfside, Kihei Surfside is an excellent property for beach ...,
> kihei_surfside_int.jpg, 3 ,135.00 ,110.00 ,125.00 ,135.00
> Kihei Surfside, Kihei Surfside is an excellent property for beach ...,
> kihei_surfside_int.jpg, 6 ,150.00 ,120.00 ,140.00 ,150.00
> Kihei Surfside, Kihei Surfside is an excellent property for beach ...,
> kihei_surfside_int.jpg, ,10 ,205.00 ,165.00 ,190.00 ,205.00
>
> So...I need to format all this data...
> basically, I need to turn it into the output you see at
> http://www.maui.net/~mchr/kihei.com/kihei_beach.html . Title and Description
> once, images for as many images as there are (2), the floorplan graphic, and
> the table for rates. I know how to do any one of these steps, but properly
> nesting conditional statements to only output the right stuff in the right
> place is just beyond my imagination...
>
> thanks,
> John Corry
>




More information about the thelist mailing list