Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder harlequin2k5's Avatar
    Join Date
    Sep 2005
    Location
    Holiday, FL
    Posts
    635
    Thanks
    18
    Thanked 0 Times in 0 Posts

    Coldfusion query issues

    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

    Code:
    <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:

    Code:
          <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!

  • #2
    Rockstar Coder
    Join Date
    Jun 2002
    Location
    USA
    Posts
    9,074
    Thanks
    1
    Thanked 328 Times in 324 Posts
    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.
    OracleGuy

  • #3
    Regular Coder harlequin2k5's Avatar
    Join Date
    Sep 2005
    Location
    Holiday, FL
    Posts
    635
    Thanks
    18
    Thanked 0 Times in 0 Posts
    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

    It's working now!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •