PDA

View Full Version : Coldfusion query issues


harlequin2k5
10-09-2005, 08:53 PM
As if I haven't done 20 bajillion cf queries in my life - I think I'm being blind and just not seeing the error.

These are my queries for this page (http://www.suncoastwebdesigns.com/test/susbcba/boardmembers.cfm)

<cfquery name="getpres" datasource="sba">
select tblboardofficers.boardofficerid, tblboardofficers.boardofficertype, tblboardofficers.boardofficerfirstname, tblboardofficers.boardofficerlastname
from tblboardofficers
where tblboardofficers.boardofficertype like 'pres%'
order by tblboardofficers.boardofficerlastname
</cfquery>
<cfquery name="getvp" datasource="sba">
select tblboardofficers.boardofficerid, tblboardofficers.boardofficertype, tblboardofficers.boardofficerfirstname, tblboardofficers.boardofficerlastname
from tblboardofficers
where tblboardofficers.boardofficertype like 'vp%'
order by tblboardofficers.boardofficerlastname
</cfquery>
<cfquery name="geted" datasource="sba">
select tblboardofficers.boardofficerid, tblboardofficers.boardofficertype, tblboardofficers.boardofficerfirstname, tblboardofficers.boardofficerlastname from tblboardofficers where tblboardofficers.boardofficertype like 'ed%' order by tblboardofficers.boardofficerlastname
</cfquery>
<cfquery name="getaed" datasource="sba">
select tblboardofficers.boardofficerid, tblboardofficers.boardofficertype, tblboardofficers.boardofficerfirstname, tblboardofficers.boardofficerlastname from tblboardofficers where tblboardofficers.boardofficertype like 'aed%' order by tblboardofficers.boardofficerlastname
</cfquery>


and these are my cfoutputs:


<cfoutput query="getpres"><p>
<div class="boardlist">#getpres.boardofficerfirstname# #getpres.boardofficerlastname#</div></p></cfoutput>

<p class="titlehead">Vice President</p>
<cfoutput query="getvp">
<p><div class="boardlist">#getvp.boardofficerfirstname# #getvp.boardofficerlastname#</div></p></cfoutput>

<p class="titlehead">Executive Director</p>
<cfoutput query="geted">
<p><div class="boardlist">#geted.boardofficerfirstname# #geted.boardofficerlastname#</div></p></cfoutput>

<p class="titlehead">Assistant Executive Director</p>
<cfoutput query="getaed">
<p><div class="boardlist">#getaed.boardofficerfirstname# #getaed.boardofficerlastname#</div></p></cfoutput>


I've tried placing the cfquery block at the output, I've tried with and without a where/order by clause

What I'm seeing is John Spicer as President and then 0 Vice Presidents (there are actually 6) 0 Executive Directors (there is 1) and 0 Assistant Executive Directors (there is 1)

I'm so used to displaying this data in a table and maybe that's where my error is as now I'm trying to do it using css.

I've been working on this since Friday night and I'm about to throw out this brand spankin new puter I just bought on Tuesday *chuckles*

Any help is greatly appreciated!

oracleguy
10-10-2005, 06:08 AM
Have you tried running the queries outside of CF to see if they return any records? If they do, then you know the problem isn't the queries but something else on the page.

Also you could try checking to see what the number of records returned in CF is. I think you can do <cfoutput>#getvp.RecordCount#</cfoutput> But I'm not sure, my CF skills are a tad rusty.

harlequin2k5
10-11-2005, 07:02 PM
Thanks OG

I actually had to go back and change the titles - instead of 'vp' I had to use 'vice'

I hadn't realized that some of the titles contained the same sequence of letters :rolleyes:

It's working now!