Try something like this:


<cfquery name="getall" datasource="mydsn">
        Select Subnet.*, SubnetInfo.*
        From Subnet
        LEFT Join SubnetInfo ON
        Subnet.IPMask = SubNetInfo.IPMask
</query>

<cfset firstIPMask = "">
<cfoutput query="Getall">
        <cfif NOT firstIPMask IS #getall.IPmask#>
                <cfset firstIPMask = #getall.IPmask#>
                Subnet: #getall.IPmask#<br>
        <cfelse>
                
        </cfif>
        <ul>
                <li>IP = #IPEnding#</li>
                <li>Name = #getall.boxname#
                <li>Description = #Getall.Desc#
        </ul>   
</cfoutput>

        

-----Original Message-----
From: Peter Benoit [mailto:[EMAIL PROTECTED]]
Sent: Friday, December 08, 2000 10:23 AM
To: CF-Talk
Subject: loops, queries, ug...


I'm confused!

I have 2 tables in the same database, one table has a list of
subnets(subnets), and the other will contain information on each
subnet(subnet_info).  The subnet in the subnets table is the unique id in
that table, which has a one to many relationship with the subnet in the
subnet_info table.

What I want to do is present a table that would present a subnet, then it's
corresponinding IP's and Info, then repeat for each subnet.  Something like:

208.208.208
        IP = 1
        Name = boxname
        Description = what this box does

208.208.209
        ect...

I'm not sure of the best method to do this.  I tried building a query on the
subnet table, then in the <cfoutput> of that query, loop through another
query on the subnet_info table... but it doesn't work.  Any ideas for me how
to do this?

TIA,
Pete
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to