One thought that quickly comes to mind is this:

Build a table States and put all 50 states in it.  Pull from it a list of
states and for each state query the database for manufacturers in that
state.  Then you could do next five records from the States table.  This
might take a performance hit.  You also might be able to do something with
GROUP BY.

Jonathan Karlen

----- Original Message -----
From: gregg Kachel <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, July 28, 2000 6:03 PM
Subject: Can this be done ?


> I'm wondering if this is possible, as I haven't had any luck.  I hope
> someone can help me =).  I am trying to do is list all the manufactures in
> my database by state. No, problem, works fine. But, I only want it to list
> five states at a time, and have a next button that will take the user to
the
> next five states. Unfortuneatly, I can only get it to go up the next five
> "records" in the database. Is there a way to have it go next to the next
> catagory ?  Thanks ahead of time,
> Gregg
> webmaster
> www.houseboatmagazine.com
>
> PS: here is the code I have so far !
>
>
> <cfquery name="manf" datasource="houseboat">
>   SELECT id, state, statename, company
>   FROM HBMF
>  Order by state
>
> </CFQUERY>
> </head>
>
>
> Click on the state or province for houseboat manufactures in that state
> only.<br><br>
> <cfparam name="row1" Default="1">
> <cfif IsDefined("row1")>
>  <cf set next_row = #start# + 9>
> </cfif>
> <cfoutput query= "manf" Group="statename">
>
> <a href="manufacturers2.cfm?state=#state#">#statename#</a>
> </cfoutput>
> <br>
> <br>
> <!--- Specify number of columns. --->
> Or, you may browse the entire listing below of houseboat manufactures.
>   <cfparam name="MaxRows" default="5">
> <cfparam name="StartRow" default="1">
>
>       <p align="center"><font color="#339999" size="+2"><b><br>
>         Manufactures</b></font></p>
>   <CFIF #manf.RecordCount# LTE 0>
>   <CFOUTPUT>
>   Sorry, no matching records.
>   </CFOUTPUT>
> <CFELSE>
>
>  <P>
>  <CFOUTPUT query="manf" GROUP="statename" startrow="#startrow#"
> Maxrows="#maxrows#">
>
> <B><font size=+1 color="##6600CC"> #statename#</font></B><Br>
>               <UL>
>    <CFOUTPUT><a href="manufacturers3.cfm?id=#id#">
>      <LI><B>#company#</B></A>
>   </CFOUTPUT>
>               </UL>
>   </cfoutput>
>
>
>
>
> </CFIF>
> <P>
> <CFOUTPUT>
> There are <b>#manf.RecordCount#</B> items in the database.<BR>
> You are currently viewing records <b>#StartRow#</B> to
<B>#Evaluate(StartRow
> + MaxRows - 1)#</B>
> </CFOUTPUT>
>
> <P><CFIF (StartRow + MaxRows) LTE manf.recordcount>
>  <a href="manufacturers.cfm?startrow=<CFOUTPUT>#Evaluate(StartRow +
> MaxRows)#</CFOUTPUT>">Next page</a>
> </CFIF>
> <P><CFIF (StartRow - MaxRows) GTE 1>
>  <a href="manufacturers.cfm?startrow=<CFOUTPUT>#Evaluate(StartRow -
> MaxRows)#</CFOUTPUT>">Previous page</a>
>
> </CFIF>
>
>
> --------------------------------------------------------------------------
----
> Archives: http://www.mail-archive.com/[email protected]/
> To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.
>

------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/[email protected]/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to