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
  #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


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

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five "checkpoints" for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

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





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