ColdFusion Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreColdFusion Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
  #1  
Old January 14th, 2004, 10:10 AM
A3M0N_ A3M0N_ is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Location: Summervile, SC
Posts: 115 A3M0N_ User rank is Corporal (100 - 500 Reputation Level)A3M0N_ User rank is Corporal (100 - 500 Reputation Level)A3M0N_ User rank is Corporal (100 - 500 Reputation Level)A3M0N_ User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 2 Days 3 h 59 m 49 sec
Reputation Power: 7
Send a message via AIM to A3M0N_ Send a message via MSN to A3M0N_ Send a message via Yahoo to A3M0N_
little coding prob...

ok, this here is my code:

Code:

<table width="90%" cellpadding="5" cellspacing="5" border="1">
	
	<tr>
		<cfoutput query="myquery" group="category">
		<td width="33%" valign="top">
			
			<p align="center"><strong>#category#</strong></p>
			
			<cfoutput>
			#field1#, #field2#
			<hr>
			</cfoutput>
		</td>
			<cfif not myquery.currentRow MOD 3>
	</tr>
	<tr>
			</cfif>
			</cfoutput>
	</tr>
</table>


usually this would output my query results in 3 columns, but apparantly the grouping is throwing this off, it comes out in this hideous mass of cells all over the place.

anyone know how to fix this????

thanks!

later

Reply With Quote
  #2  
Old January 14th, 2004, 12:49 PM
kiteless kiteless is offline
Moderator
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,627 kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 4 Days 10 h 8 m 55 sec
Reputation Power: 53
I'm not sure what format you're trying for? Do you want 3 table columns? Like this?

<tr>
<td>category1<td>
<td>field1<td>
<td>field2<td>
</tr>

Keep in mind that to use the "group" attribute you must be ordering your query by that column as well.

Reply With Quote
  #3  
Old January 14th, 2004, 01:05 PM
A3M0N_ A3M0N_ is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Location: Summervile, SC
Posts: 115 A3M0N_ User rank is Corporal (100 - 500 Reputation Level)A3M0N_ User rank is Corporal (100 - 500 Reputation Level)A3M0N_ User rank is Corporal (100 - 500 Reputation Level)A3M0N_ User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 2 Days 3 h 59 m 49 sec
Reputation Power: 7
Send a message via AIM to A3M0N_ Send a message via MSN to A3M0N_ Send a message via Yahoo to A3M0N_
no, like this:

<tr>
<td>
category1

field1, field2
</td>

<td>
category2

field1, field2
</td>

<td>
category3

field1, field2
</td>
</tr>

<tr>
<td>
category4

field1, field2
</td>

<td>
category5

field1, field2
</td>

<td>
category6

field1, field2
</td>
</tr>

thanks!

Reply With Quote
  #4  
Old January 15th, 2004, 12:31 PM
kiteless kiteless is offline
Moderator
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,627 kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 4 Days 10 h 8 m 55 sec
Reputation Power: 53
Well then, as long as your query is ordered by category, you should be able to do it like this:

<table>
<cfoutput query="myquery" group="category">
<tr>
<td>
#myQuery.category#
<cfoutput>
#field1# #field2#
</cfoutput>
</td>
</tr>
</cfoutput>
</table>

Basically everything inside the outer cfoutput block, but not inside the inner cfoutput block, will only execute once for each category. But the code in the inner cfouput block will execute for each data row present for each category.

Last edited by kiteless : January 15th, 2004 at 12:33 PM.

Reply With Quote
  #5  
Old January 15th, 2004, 02:59 PM
A3M0N_ A3M0N_ is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Location: Summervile, SC
Posts: 115 A3M0N_ User rank is Corporal (100 - 500 Reputation Level)A3M0N_ User rank is Corporal (100 - 500 Reputation Level)A3M0N_ User rank is Corporal (100 - 500 Reputation Level)A3M0N_ User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 2 Days 3 h 59 m 49 sec
Reputation Power: 7
Send a message via AIM to A3M0N_ Send a message via MSN to A3M0N_ Send a message via Yahoo to A3M0N_
ok, maybe a visual aid will help...

i don't want my table like this:


but like this:


does this help??

thanks again!!

later

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreColdFusion Development > little coding prob...


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway