Skip to main content
February 22, 2009
Question

cfquery

  • February 22, 2009
  • 3 replies
  • 1065 views
Newbie here - Recently downloaded CF8 and have been successfully executing the dreamweaver tutorial (develop web application) until down. Using DW8 and CF8 I have successfully connected to my data base and created a correct record set which when tested returns all records. Then executing it in a .cfm program, trying to load the data into a table, i get only the first record; i changed the order to desc and got only the last record.. following is the code.l.<cfquery name="players" datasource="connsilvereagles">
SELECT *
FROM player
ORDER BY playernumber DESC</cfquery>
do not know what i have done wrong....any help extremely appreciated. thanks.
This topic has been closed for replies.

3 replies

Known Participant
June 2, 2009

Use cfoutput for table display .So that you can output all the coldfusion variables and also paginate using the attributes startRow and

maxRows

Participating Frequently
May 22, 2009

NewsGroup_User is right in that aspect.  Even in ASP, you must create the loop around the call and advance the record point until the end of the file. (EOF).   The good thing about a CFQUERY is that it works like a batch process.  So you can put the SQL/T-SQL/PL-SQL code into there and it should work just as it does in a query on the server.

Inspiring
February 22, 2009
i bet you forgot to add query="players" to you <cfoutput> tag:

<cfoutput query="players">

without specifying the query name, <cfoutput> will not 'loop' over the
query's recordset, but will only output the first referenced value from
the query - basically the query's first row values.

Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com/
BKBK
Community Expert
Community Expert
May 30, 2009
<cfoutput query="players">


Or <cfloop query="players">