Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Populating javascript array from query

Posted on 2001-09-16
5
Medium Priority
?
611 Views
Last Modified: 2013-12-16
I am developing a website in coldfusion and am pretty unfamiliar with javascript. I have also posted this question in the javascript area. I need to populate a javascript array with the following query. Could someone please help me figure this out.

<CFQUERY DATASOURCE="myDsn" NAME="myQueryName">
SELECT modelNum,partNum,defaultPrice,description
FROM components
</CFQUERY>


Thanks in advance

Doug

P.S God bless the U.S.A
0
Comment
Question by:DBrown
5 Comments
 
LVL 1

Expert Comment

by:deestuar
ID: 6487087
Hi,
I've done something simialr with ASP before not with coldfusion. But is a general methodology
Scan through a record set building up a string array
of all the values in the recordset.
Write it out in your javascript code.

0
 
LVL 9

Accepted Solution

by:
miron earned 400 total points
ID: 6487381
Make a struct in javascript, with mapping between recordset fields and the struct members. Instantiate an array of structs and assign values from recordset fields accordingly using dot separator to assign value to individual members of struct.
0
 

Expert Comment

by:CleanupPing
ID: 9281563
DBrown:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0
 
LVL 34

Expert Comment

by:arbert
ID: 9552238
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

Accept Miron's Comment

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

Arbert
EE Cleanup Volunteer
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Originally, this post was published on Monitis Blog, you can check it here . It goes without saying that technology has transformed society and the very nature of how we live, work, and communicate in ways that would’ve been incomprehensible 5 ye…
An alternative to the "For XML" way of pivoting and concatenating result sets into strings, and an easy introduction to "common table expressions" (CTEs). Being someone who is always looking for alternatives to "work your data", I came across this …
The purpose of this video is to demonstrate how to integrate Mailchimp with Facebook. This will be demonstrated using a Windows 8 PC. Mailchimp and Facebook will be used. Log into your Mailchimp account. : Click on your name. Go to Account Setti…
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

927 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question