Link to home
Start Free TrialLog in
Avatar of Zac123
Zac123Flag for United Kingdom of Great Britain and Northern Ireland

asked on

cfquery, columnList results display twice


i'm using this query to pull column names:

SELECT *
FROM ProdFields
WHERE 1 = 2

i'm using this to output the results:

<cfset ColList = listChangeDelims(valueList(GetCurrentProdFieldNames.columnList),",</br>")>
<cfoutput>#ColList#</cfoutput>

the table that i'm querying only has two columns currently but i view the output i see them duplicated like so:

AUTOID
PRODNAME
AUTOID
PRODNAME


any ideas why?

Avatar of Zac123
Zac123
Flag of United Kingdom of Great Britain and Northern Ireland image

ASKER

just an update to this problem. it seems to repeat itself depending on how many colums there are.
i.e. i now have 5 columns so the output block repeats 5 times.
SOLUTION
Avatar of gdemaria
gdemaria
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Zac123

ASKER

yeah i tried that first off. but the output is just:

#ColList# and not data
Please show your block of code all around this item..
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
To show the column names, try

<cfset ColList = listChangeDelims(GetCurrentProdFieldNames.columnList,</br>)>
<cfoutput>#ColList#</cfoutput>
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial

oh crap, of course... you are trying to show the list of column names...

Good catch agx


I couldn't see the forest through all the trees
That was me yesterday :) Tag, you're it.
Avatar of Zac123

ASKER

LOL

sorry for slow reply. had to travel home.

thanks for you input peeps.

agx was right, didnt need the value list in there. seems to be working great!

many thanks
zac
Avatar of Zac123

ASKER

sorry for planting so many trees! :-)