Re: Best Method - Maybe Array or Structure?
On 9 Aug, 19:06, "NewPrism" <[email protected]> wrote:
> I have a situation where a web client answers 20-30 questions for their
> profile, but the site owner wants only 5 or 6 of the Question Answers to show
> up on the public side such as QuestionID=10 (StoreName), QuestionID=9 (Store
> I can query the specified QuestionIDs and Answers fine for a unique
> locationID. But because the answers need to show up in various tables of
> various sections of the public profile page I need a convenient way to display
> the answers.
> Currently I cfloop the query and assign the answer as the questionID which
> works fine - unless the questionID didn't exist when the client filled in
> original profile. I cannot get an IsDefined to work and the StructureKeyExists
> requires two parameters which I don't think would work.
> Anyone with a better idea?
> <cfloop query="location_answers">
> <cfset Question[#QuestionID#] = "#Answer#">
> <! --- need method of verifying the question exists --->
> <! --- the following work unless the locationID does not have a record
> representing QuestionID = 9 --->
> Location Name: #question#
> Store Hours: #question#
Why would not <if structKeyExists(Question, 9)> work?