Hi i have come to a complex situation where within my database I have column1 - column50 So i need display the values of the columns so I query such as <cfquery name="get" datasource="blah"> select * from table </cfquery> Now the problem is with a huge ammount (50) column, I wanted to query out the value from column1 to column50 im doing <cfloop from="1" to="50" index="i"> #get.column#i## </cfloop> Problem is i nested ## within another ## which it doesnt works. I tried () also wont work. Please help
Do you mean instead of: <cfquery name="get" datasource="blah"> select * from table </cfquery> You want: <cfquery name="get" datasource="blah"> select column1,column2,column3 ect from table </cfquery> But there are 50 colums?
actually i wanted to do a looping form which captures queries <cfquery name="qf"> select * from applicants where name in ( <cfqueryparam ...> ) </cfquery> </cfquery> From above i have a lot of applicant list that will be obtain from the database then each needed to be displayed in the form to the user and they may modified the value. Thing is that it displayed repeatly the list of applicants at a time instead one by one and after each value is change one button to confirm the modification to all the applicant. The below is partial of my code to display the queries of applicants and the user can change the value in the textfield to modify <form ...> <cfoutput query="qf"> <cfparam name="i" default="1"> <input value=#qf.id# type="hidden" name="id#i#"> *id is my primary key <input value="#qf.telephone#" name="telephone#i#"> <cfset i = i+1> </cfoutput> <input type="submit" ...>* So only one button exist to modify all </form> Ok right after that im stuck with this <cfoutput query="qm"> <cfparam name="j" default="1"> <cfquery...> update applicant set telephone = '#form.telephone#j##' where id = #form.id#j## </cfquery> <cfset j=j+1> ... *this is the problem here. i want to loop each form to be unique so each record know what value to be updated with. Sometimes i dont even know if im doing it right or logically. Appreciate if anyone can help else i have to make the system update the files one by one (which is tedious to the client).
Anyone any idea? Im thinking of arrays but i am not good in using them. I just need the update query to successfully loop with each form.telephone and form.id
update applicant set telephone = '#evaluate("form.telephone#j#")#' where id = #evaluate("form.id#j#")# Should work for you.