Contact Us Forum Rules Search Archive
WebProWorld Part of WebProNews.com
Page One Link To Us Edit Profile Private Messages Archives FAQ RSS Feeds  
 

Go Back   WebProWorld > Webmaster, IT and Security Discussion > Web Programming Discussion Forum
Subscribe to the Newsletter FREE!


Register FAQ Members List Calendar Arcade Chatbox Mark Forums Read

Web Programming Discussion Forum Working with an API? Developing a plugin? Writing a Mod or script for your favorite blog, Web 2.0 site or Forum? Welcome.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 11-06-2006, 03:40 PM
WebProWorld Veteran
 

Join Date: Aug 2006
Location: Burlington, Ontario, Canada.
Posts: 406
jtracking RepRank 1
Default ColdFusion Table Data.

Hello all. I have a bit of a problem and am still searching for an answer on the net and thought this is a good place to ask too...

I am trying to extract from our sales table information and put it into a table to display (as usual) and am having a difficult time. Below is the code I am using.

Code:
<h3>Sales Statistics by Country</h3>


<cfparam name="i" default=0>
<cfquery name="rate" datasource="#request.dsn#">
	select rate from rate;
</cfquery>

<cfquery name="sales_can" datasource="#request.dsn#">
	select sum(total - pst - gst - hst - shipping_price) as total, sale_date, count(sales_id) as num, currency_id from sales where currency_id = 1 and od_archive = 'no' and franchise_id = 0 and wholesale = #request.dbfalse# group by currency_id;
</cfquery>
<cfloop query="sales_can">	
	<cfset Currency = year(currency_id)>
	<cfset Sales = num>
	<cfset Totals = total>
	<cfset Years = sale_date>
</cfloop>

<table border="0" cellpadding="3" cellspacing="0" width="100%" class="mytable">
<tr>
	<th align="center">#</th>
	<th align="center">Currency</th>
	<th align="center"># of Sales</th>
	<th align="center">Dollar Total</th>
	<th align="center">Years</th>
</tr>

<cfloop from=1 to=20 index="i">
<tr bgcolor="#EEF7FF">
	
	<td align="center">#i#<cfset i eq (i + 1)></td>
	<td align="center">#Currency#</td>
	<td align="center">#Sales#</td>
	<td align="center">#Totals#</td>
	<td align="center">#Years#</td>

</tr>
</cfloop>
</table>
Im getting a table that is just displaying for each row the titles of each row, all enclosed between number signs (#). In other words the data is either not being extracted properly from the database or I have written something wrong and it's not displaying right.

If anyone can take a peek at my code and hopefully see the problem that would be great. I thank everyone for their time.

Cheers.
__________________
Post as-it-happens crime stories of criminal behaviour at crimedigg.com
Reply With Quote
  #2 (permalink)  
Old 11-09-2006, 07:41 PM
WebProWorld New Member
 

Join Date: Dec 2005
Posts: 14
meddlingwithfire RepRank 0
Default

Well, for starters, there's no <cfoutput> tag wrapped around anything. So it's not going to evaluate any of your code.
Reply With Quote
Reply

  WebProWorld > Webmaster, IT and Security Discussion > Web Programming Discussion Forum
Tags: , ,



Thread Tools
Display Modes

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
Trackbacks are On
Pingbacks are On
Refbacks are On


Search Engine Optimization by vBSEO 3.2.0