...

Moving to next record after specified time

Kryptor2k
08-15-2011, 05:59 PM
Hey all,

I'm looking for a way in ColdFusion of calling a query that will pull data based on category criteria entered, ie employment.

When the results come back I want to be able to show the result of 1 record and then get the query to progress to the next one after 30 seconds.

Would this be possible to do in CF?

Eagerly awaiting an answer whether good or bad :thumbsup:

Dave

Gjslick
08-17-2011, 09:32 PM
One option is to refresh the webpage every 30 seconds (using JavaScript or a meta refresh tag), which would fetch the next record. You'd probably have to add a url query parameter to tell the server the next record to retrieve.

Otherwise, using AJAX to pull in a new result and updating the page would be best.

Kryptor2k
08-18-2011, 06:26 PM
Gjslick,

Thanks for the reply. The autorefresh moving to the next query results is one I was looking at myself.

I'm not too sure on the AJAX thing. Is there any recommended reading on sites that will make that sound any easier since I've never really used it before?

Thanks
Dave. :thumbsup:

Kryptor2k
08-22-2011, 06:53 PM
Ok,

With regards to using the Meta-Refresh tag.

I have a URL.Variable setup to pick on the ID field of the database. How do I now get CF to move to the next record in the query using the meta refresh?

Any help is greatly appreciated at this moment in time ;)

Thanks to anyone who can give me some light on this one in advance =)

Dave

Gjslick
08-23-2011, 04:41 PM
You have to now query the next record. There is no "moving" per se.


<cfquery name="myQuery" datasource="myDataSource">
SELECT myField FROM myTable
WHERE ID = #url.myIdParam#
</cfquery>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum