You can just use
maxrows="12"
Although, I think that something may be wrong with your logic. maybe if you post some of our code, I can take a look at the suggested approach.
maxRows will do the trick though
UPDATE
Recall that maxrows must be used with the "cfoutput query" because the cfloop query does not support it.
In this case, you will do something like:
<cfoutput query="myQuery" maxRows="12">
UPDATE UPDATE
Realizing what exactly you wanted, I wrote the following code, which, in my opinion, you need:
<cfscript> qryTest = QueryNew("name,email"); newRows = QueryAddRow(qryTest,5); tmp = querySetCell(qryTest, 'name', 'John', 1); tmp = querySetCell(qryTest, 'email', ' John@email.com ', 1); tmp = querySetCell(qryTest, 'name', 'Paul', 2); tmp = querySetCell(qryTest, 'email', ' Paul@bob.com ', 2); tmp = querySetCell(qryTest, 'name', 'George', 3); tmp = querySetCell(qryTest, 'email', ' George@bob.com ', 3); tmp = querySetCell(qryTest, 'name', 'Ringo', 4); tmp = querySetCell(qryTest, 'email', ' Ringo@bob.com ', 4); tmp = querySetCell(qryTest, 'name', 'Yoko', 5); tmp = querySetCell(qryTest, 'email', ' Yoko@bob.com ', 5); </cfscript> <cfdump var="#qryTest#"> <form name="test"> <cfoutput> <cfloop from="1" to="12" index="ii"> <cfif ii GT qryTest.recordCount> <cfset tmp = QueryAddRow( qryTest, ii)> </cfif> Name: <input type="text" name="name_#ii#" value="#qryTest.name[ii]#"><br /> Wmail: <input type="text" name="email_#ii#" value="#qryTest.email[ii]#"><br /><br /> </cfloop> </cfoutput> </form> <cfdump var="#qryTest#">
This will add new lines to your query dynamically if necessary (i.e. if you do not have 12 lines in your recordset)
It imitates a set of records so you can copy and paste the code and see the results.
hope this helps; -)