Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New to the CF scene
    Join Date
    Aug 2011
    Location
    UK
    Posts
    3
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Question Moving to next record after specified time

    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

    Dave

  • #2
    Regular Coder
    Join Date
    Feb 2009
    Location
    NJ, USA
    Posts
    476
    Thanks
    2
    Thanked 70 Times in 69 Posts
    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.

  • Users who have thanked Gjslick for this post:

    Kryptor2k (08-22-2011)

  • #3
    New to the CF scene
    Join Date
    Aug 2011
    Location
    UK
    Posts
    3
    Thanks
    1
    Thanked 0 Times in 0 Posts
    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.

  • #4
    New to the CF scene
    Join Date
    Aug 2011
    Location
    UK
    Posts
    3
    Thanks
    1
    Thanked 0 Times in 0 Posts
    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

  • #5
    Regular Coder
    Join Date
    Feb 2009
    Location
    NJ, USA
    Posts
    476
    Thanks
    2
    Thanked 70 Times in 69 Posts
    You have to now query the next record. There is no "moving" per se.

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

  • #6
    New to the CF scene
    Join Date
    Jul 2013
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I had the same queries thanks for answering


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •