Question
building tables from multiple columns in db
I'll asked this question several months back and i still cant
figure out how to do this... or what is best practices for doing
this.
im building a product page and i have table header column data in the database..with headings column1, column2 ...
and table infomation table
is it best to have your data in one column comma delimited? or is there aa way to query and get the information for that product table heder and table info and output in template
the thing is because the table column very from product to product ... the template needs to loop according to how many columns of information there is.
what is best practices for table data in database and outputing columns to cfm template
this kind of works..but returns a error: Invalid CFML construct found on line 1 at column 6.
<cfquery datasource="info" name="tableheader">
Select * from tableheaders
WHERE tableheadersID = 35
</cfquery>
</head>
<body>
<table border="1">
<tr>
<cfloop list="#tableheader.column1#" index="column">
<cfoutput><th>#column#</th></cfoutput>
</cfloop>
</tr>
<cfoutput query="tableheader">
<tr>
<cfloop list="#tableheader.column1#" index="column">
<td>#Evaluate(column)#</td>
</cfloop>
</tr>
</cfoutput>
</table
also..CF livedocs.recommends not using the evaluate because of its overhaed
so in a nutshell.how do you retrive/ output multiple columns for a particular product ID
Thanks for any help!
im building a product page and i have table header column data in the database..with headings column1, column2 ...
and table infomation table
is it best to have your data in one column comma delimited? or is there aa way to query and get the information for that product table heder and table info and output in template
the thing is because the table column very from product to product ... the template needs to loop according to how many columns of information there is.
what is best practices for table data in database and outputing columns to cfm template
this kind of works..but returns a error: Invalid CFML construct found on line 1 at column 6.
<cfquery datasource="info" name="tableheader">
Select * from tableheaders
WHERE tableheadersID = 35
</cfquery>
</head>
<body>
<table border="1">
<tr>
<cfloop list="#tableheader.column1#" index="column">
<cfoutput><th>#column#</th></cfoutput>
</cfloop>
</tr>
<cfoutput query="tableheader">
<tr>
<cfloop list="#tableheader.column1#" index="column">
<td>#Evaluate(column)#</td>
</cfloop>
</tr>
</cfoutput>
</table
also..CF livedocs.recommends not using the evaluate because of its overhaed
so in a nutshell.how do you retrive/ output multiple columns for a particular product ID
Thanks for any help!