I'm running ColdFusion 2016. I have a cfloop
which pulls in data from a query, all other ColdFusion queries work fine on the page and if I pull in the same variable in an output outside the loop, it works fine, except the loop is giving me an error. The error output says:
Variable GPS_LATITUDE is undefined.
Which is correct, as in the database there is no GPS_LATITUDE
but there is a GPS_LATITUDE1
.
I need to add the loop number on the end of the variable so as it loops pulls in the data gps_latitude1
, gps_latitude2
, gps_latitude3
not just gps_latitude
.
My loop code is...
<cfoutput>
<cfloop index="i" from="1" to="3">
<td><p>#gps_latitude[i]#</p></td>
<td><p>#gps_longitude[i]#</p></td>
</cfloop>
</cfoutput>
Any guidance much appreciated.