ColdFusion Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

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:
  #1  
Old June 13th, 2003, 12:29 PM
trishaDawn trishaDawn is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Posts: 4 trishaDawn User rank is Private First Class (20 - 50 Reputation Level)trishaDawn User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
output 1 column into separate html tables

HELP. I am new to CF and I am stumped!!

I have only one column in a database that I need to "divide", preferably in half, but this will not be possible if I have an odd number of records. I want to output 1/2 of column 1 in its own html table, and I'd like to output the other half of column 1 in its own html table, on separate parts of the page. These HTML tables will be independent of each other because there will be information on the web page in between these two html tables.

Do I need two queries, instead of one??

Therefore it would be something like this:

<td>
<table><!---1/2 of column 1 on left side of page--->
A
B
C
</table>
</td>

<td>
<table>
<!---nondatabase information--->
</table>
</td>

<td>
<table>
<!---1/2, or the remainder of column 1 on right side of html page--->
D
E
F
G
</table>
</td>

PLease, anyone, can you help?
THANKS IN ADVANCE!
Comments on this post
JimmyGosling agrees!

Reply With Quote
  #2  
Old June 13th, 2003, 01:46 PM
ecastillo ecastillo is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Location: Colorado
Posts: 6 ecastillo User rank is Private First Class (20 - 50 Reputation Level)ecastillo User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
You could do something like this.

Code:
<cfoutput query="queryname" startrow="1" maxrows="5">
#variables.name#
</cfoutput>

<cfoutput query="queryname" startrow="6" maxrows="10">
#variables.name#
</cfoutput>


That what your looking for?
Comments on this post
JimmyGosling agrees!

Reply With Quote
  #3  
Old June 13th, 2003, 02:02 PM
trishaDawn trishaDawn is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Posts: 4 trishaDawn User rank is Private First Class (20 - 50 Reputation Level)trishaDawn User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thanks For Your Response. I was unaware of the startrow and maxrow features (I am a newbie!).

Someone on another list answered this for me in a similar fashion.

I'll post for anyone else having a similar problem:

<!--- Get the data --->
<cfquery name="qryName" ..>
SELECT *
FROM tblName
</cfquery>

<!--- Set vars --->
<cfset locTotalRecordCount=qryName.RecordCount>
<cfset locMaxRows=Ceiling(locTotalRecordCount / 2)>
<cfset locStartRow=1>

<td>
<table><!---1/2 of column 1 on left side of page--->
<cfoutput query="qryName" startrow="#locStartRow#" maxrows="#locMaxRows#">
<tr><td>#qryName.var#</td></tr>
<!--- Increment the locStartRow var --->
<cfset locStartRow=locStartRow + 1>
</cfoutput>
</table>
</td>

<td>
<table>
<!---nondatabase information--->
</table>
</td>

<td>
<table>
<cfoutput query="qryName" startrow="#locStartRow#" maxrows="#locMaxRows#">
<tr><td>#qryName.var#</td></tr>
</cfoutput>
</table>
</td>

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreColdFusion Development > output 1 column into separate html tables

Developer Shed Advertisers and Affiliates



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 | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap