House of Fusion
Search over 2,500 ColdFusion resources here
  
Home of the ColdFusion Community

Mailing Lists
Home /  Groups /  ColdFusion Talk (CF-Talk)

Need Assistance with created a variable from queried data

  << Previous Post |  RSS |  Sort Oldest First |  Sort Latest First |  Subscribe to this Group Next >> 
Hello -
Jeanmarie Richardson
05/29/08 11:47 A
hey there,
William Seiter
05/29/08 11:58 A
Hi William,
Jeanmarie Richardson
05/29/08 12:09 P
UPDATE --
Jeanmarie Richardson
05/29/08 12:56 P
Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Jeanmarie Richardson
05/29/2008 11:47 AM

Hello - I am not sure how to approach this -- I have created a zip code radius search to locate stores accross the us.  That part is working fine.  I would like to take this a step further and plot these locations on a Google Map.  I have have everything working great with Static data.   I now need to migrate on piece of the code so that the data points are plotted dynamically.   I need to create a variable from a the result of queried data.  Not sure if an array would work here (not my strong point)  In any case here is a snippet of code that I am working with.  If this data was populated manually, it works perfect.  When I try to do this by outputting a query I get no data. Thanks for you help. var markers = [ <cfoutput query="getlocations">{ 'abbr': 'A', 'name': '#firstname# #middleinit# #lastname#, #designation#', 'latitude':#lat#, 'longitude':#long#, 'wp':'http://www.mysite.com/locator/locate.cfm' }, </cfoutput> ];

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
William Seiter
05/29/2008 11:58 AM

hey there, I am not familiar with the var that gets sent to google for this, however I did see what may be an unintended syntax error. In this code, you don't have the closing single quote after the 'first, middle, last' names and then again before the 'designation'. I am assuming that google is receiving this information as an incorrect number of parameters. Hope this helps, William var markers = [ <cfoutput query="getlocations">{ 'abbr': 'A', 'name': ----- Excess quoted text cut - see Original Post for more -----

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Jeanmarie Richardson
05/29/2008 12:09 PM

Hi William, Thanks.  The closing quote is actually after designation.  However my problem specfically is that I cannot get this to ourput the group of data.  At best I only get one record. Thanks.

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Charlie Griefer
05/29/2008 12:13 PM

could it be that you end up with a trailing comma after your <cfoutput> block executes? can you paste the generated code (view source in the browser) to http://www.nomorepasting.com or http://pastebin.com/ ? On Thu, May 29, 2008 at 9:07 AM, Jeanmarie Richardson <jeannie@tdai.net> wrote: > Hi William, > Thanks.  The closing quote is actually after designation.  However my problem specfically is that I cannot get this to ourput the group of data.  At best I only get one record. > > Thanks.

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Jeanmarie Richardson
05/29/2008 12:56 PM

UPDATE -- I am getting the data to query properly now, but now what I need to do is set the whole thing as a single variable so that I can call it later in the code...   should I simply put a cfset tag around it?

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
William Seiter
05/29/2008 01:17 PM

to save multiple lines of code or 'formatted' code, you can use <cfsavecontent variable='[varname]'></cfsavecontent> > UPDATE -- > > I am getting the data to query properly now, but now what I need to do > is set the whole thing as a single variable so that I can call it > later in the code...  should I simply put a cfset tag around it?


<< Previous Thread Today's Threads Next Thread >>

Search cf-talk

May 24, 2012

<<   <   Today   >   >>
Su Mo Tu We Th Fr Sa
     1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31     

Designer, Developer and mobile workflow conference