Zac123
asked on
query_name.columnList - display vertically?
hi all,
is it possible to force a br tag after each comma in a query_name.columnList?
i can give more info if needed
z
is it possible to force a br tag after each comma in a query_name.columnList?
i can give more info if needed
z
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
If you are after the column names, you should be able to grab them after a CFQUERY. It doesn't matter how many records are returned 0, 1, or many
<cfquery name="myQuery" datasource="...">
SELECT * FROM ProdFields
</cfquery>
<cfoutput>#myQuery.columLi st#</cfout put>
If you're doing much more than that, perhaps there is a problem with the specific code; if so, please post the code.. Thanks
<cfquery name="myQuery" datasource="...">
SELECT * FROM ProdFields
</cfquery>
<cfoutput>#myQuery.columLi
If you're doing much more than that, perhaps there is a problem with the specific code; if so, please post the code.. Thanks
ASKER
Yes that exactly what i was doing BUT from looking at the cfdump info i realised that by doing:
SELECT *
i was querying the db for everything in the table, and the plan is for this table to be big!
so i added:
LIMIT 1
but apart from that my code is the same as yours. even if i take the LIMIT 1 out it still returns the whole thing twice:
AUTOID
PRODNAME
AUTOID
PRODNAME
however i'm going to close the question and award the points because the original question has been answered. i will post back with a new question after i have done some googling.
many thanks again
gdemaria.
z
SELECT *
i was querying the db for everything in the table, and the plan is for this table to be big!
so i added:
LIMIT 1
but apart from that my code is the same as yours. even if i take the LIMIT 1 out it still returns the whole thing twice:
AUTOID
PRODNAME
AUTOID
PRODNAME
however i'm going to close the question and award the points because the original question has been answered. i will post back with a new question after i have done some googling.
many thanks again
gdemaria.
z
> i was querying the db for everything in the table, and the plan is for this table to be big!
you can also not return any rows, so this will work as well..
SELECT * FROM TABLE WHERE 1 = 2
that will not return any rows, but will give you your column names
In your new question, please post some code, the problem is probably specific to your code as you have the right approach
you can also not return any rows, so this will work as well..
SELECT * FROM TABLE WHERE 1 = 2
that will not return any rows, but will give you your column names
In your new question, please post some code, the problem is probably specific to your code as you have the right approach
ASKER
SELECT *
FROM ProdFields
LIMIT 1
results in:
AUTOID,
PRODNAME,
AUTOID,
PRODNAME
you see how this table only has two colums but its repeated twice.
before using the SELECT *
i was using:
SHOW COLUMNS
Butr that gave me:
EXTRA
FIELD
TYPE
NULL
KEY
DEFAULT
EXTRA
which is not what i'm after as its not actually the column names.....