Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7020757
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T23:21:35+00:00 2026-05-27T23:21:35+00:00

I’ve mostly only used coldfusion for queries before never needed structs or any object

  • 0

I’ve mostly only used coldfusion for queries before never needed structs or any object notation until now. The server I am working on doesn’t have debugging turned on just a “500- internal server error.” so I am unable to see why my code is not working and sadly I do not have the ability to turn debugging on.

By trial and error with commenting blocks out I’ve noticed the errors are occurring in my struct line, and adding the struct to my array. From what I’ve read of the CF documentation I do not see any syntax errors but any help would be much appreciated as to if I have any bad logic or what could be wrong.

 <cfset dataArray = []>
 <cfset i = 0>
 <cfloop query="getMembers">
        <cfquery name="getmaps" datasource=“a" dbtype="odbc">
        SELECT       member_id, mlong, mlat
        FROM         maps 
        WHERE       member_id = '#getMembers.MemberID#'
        </cfquery>
        <cfif getmaps.recordcount eq 1>
            <!--- temp structure to insert into array --->
            <cfset dataTemp = {
                memberID = getMemebers.memberID, 
                name = getMemebers.MemberName, 
                long = getmaps.mlong, 
                lat = getmaps.mlat 
            }>
            <cfset dataArray[i] = dataTemp>
            <cfset i++>
        </cfif>
    </cfloop>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T23:21:36+00:00Added an answer on May 27, 2026 at 11:21 pm

    I addition to Shawn’s comment, I believe you’ll have a problem with starting your array index at 0, rather than 1. Coldfusion begins array indices at 1.

    edit Some more suggestions:

    <cfset dataArray = []>
     <cfloop query="getMembers">
            <!--- Not usually a good idea to query each time through a loop - should be able to do a single query outside it --->
            <cfquery name="getmaps" datasource=“a" dbtype="odbc">
            SELECT       member_id, mlong, mlat
            FROM         maps 
            WHERE       member_id = <cfqueryparam value='#getMembers.MemberID#' cfsqltype="cf_sql_varchar"><!--- assuming varchar since you had quotes around it --->
            </cfquery>
            <cfif getmaps.recordcount eq 1>
                <!--- temp structure to insert into array --->
                <cfset dataTemp = {
                    memberID = getMembers.memberID, 
                    name = getMembers.MemberName, 
                    long = getmaps.mlong, 
                    lat = getmaps.mlat 
                }>
                <cfset ArrayAppend(dataArray,dataTemp)>
            </cfif>
    </cfloop>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm starting Calculus this semester. I've used programming (or scripting) languages before, mostly PHP
my company is small with only one full time tester, and mostly we're doing
I mostly use Eclipse but have mentionned Netbeans on my cv. Are there any
I've managed to mostly ignore all this multi-byte character stuff, but now I need
Traditionally I have always used an ID column in SQL (mostly mysql and postgresql).
I am making an app that is readily available and MOSTLY used on phones,
I'm mostly a PHP developer. Now I have a client steering me in the
I have a server application that I am rewriting in C++ and this used
Are IDEs always a Good Thing(tm)? I used to use only jEdit, but a
I've just started using Dapper for a project, having mostly used ORMs like NHibernate

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.