Is it possible to refresh page and show remainder of recodset?

I am using the below code to show 45 records in a dual column, the page will refresh every 30 secs.  how ever I would like it to show on the refresh the remainder of the records if they are GT 45 until it hits the final record then it can start again from 1-45?

any insight would be great.
(in case you want to know it will be for a message center that will display all messages received on a screen so people can come pick it up)



code is as follows:

<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="Refresh" content="30">
<cfquery name="get_mess" datasource="noticias">
Select * from news
</cfquery>
</head>

<body>
<cfset numberOfRecordsBeforeHeaderDisplay = 45>
<cfset pageBreakCounter = 0>


<cfset numberofrecords = "#get_mess.recordcount#">
<Cfset TotalPages =  numberofrecords/numberOfRecordsBeforeHeaderDisplay >

<cfset page =1>



<cfoutput query="get_mess">
<!--- Display header --->

<cfif get_mess.currentRow mod numberOfRecordsBeforeHeaderDisplay EQ 1>
 <cfif pageBreakCounter eq 0>
    <!-- start newspaper table -->

 
 
    <div align="center">
      <em><strong>MESSAGE CENTER</strong></em>
      </div>
    <table width="100%" cellpadding="0" cellspacing="0">
   
      <tr>
 </cfif>
 <cfset pageBreakCounter = IncrementValue(pageBreakCounter)>
  <td width="5%">
        <table width="100%" height="90%" cellpadding="0" cellspacing="0">
          <tr>
            <td width="81%" valign="top" align="left">Name</td>
           
           <td width="20">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
          </tr>
          <td> </cfif>
          <!--- table cell display --->
          <tr> <font face="Arial, Helvetica, sans-serif" size="2">
            <td width="81%" valign="top" align="left">#Message_for# Rec: #timeformat(message_date,"hh:mm tt")# #message_company#</td>
           
         
            </font>
          <!--- Display close table --->
          <td> <cfif get_mess.currentRow mod numberOfRecordsBeforeHeaderDisplay EQ 0 OR get_mess.currentRow EQ get_mess.recordCount>
        </table>
  </td>
    <cfif pageBreakCounter mod 2 eq 0 OR get_mess.currentRow EQ get_mess.recordCount>
      <cfset pageBreakCounter = 0>
      <!--- close newspaper table --->
  </table>
      <br class="pageBreak">
        <cfset Page=Page+1>
    </cfif>
</cfif>
</cfoutput>

</body>
</html>
jriver12Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

James RodgersWeb Applications DeveloperCommented:

do query



<cfif isDefined("url.start")>
   <cfset iStartRow=#url.iStartRow#+50>
   <cfif iStartRow gt query.recordCount>
      <cfset iStartRow=1>
   </cfif>
<cfelse>
    <cfset iStartRow=1>
</cfif>
<meta http-equiv="Refresh" content="30;URLpage.cfm?start=#iStartRow#">

<cfouptput query="" startrow="iStarRow" maxrows="50">
0
jriver12Author Commented:
the refresh portion works unfortunately I keeps returning the same record set.

<!--- get the messages --->
<cfquery name="get_mess" datasource="noticias">
Select * from news
</cfquery>

<cfif isDefined("url.start")>
   <cfset iStartRow=#url.iStartRow#+45>
   <cfif iStartRow gt query.recordCount>
      <cfset iStartRow=1>
   </cfif>
<cfelse>
    <cfset iStartRow=1>
</cfif>
<meta http-equiv="Refresh" content="30;URLpage.cfm?start=#iStartRow#">



<table>
 <tr>
 <td> Messages have been rececived for the following</td>
 </tr>
<cfoutput query="get_mess" startrow="#iStartRow#" maxrows="45"><tr>
 <td width="81%" valign="top" align="left">#Message_for# Rec: #timeformat(message_date,"hh:mm tt")# #message_company#<br>
 </td>
</tr>
</cfoutput>


</table>
0
James RodgersWeb Applications DeveloperCommented:
do you have the met tag between cfoutput tags?

<cfoutput>
   <meta http-equiv="Refresh" content="30;URLpage.cfm?start=#iStartRow#">
</cfoutput>
0
Cloud Class® Course: Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

jriver12Author Commented:
this is what I have done with no luck.
<!--- get the messages --->
<cfquery name="get_mess" datasource="noticias">
Select * from news
</cfquery>

<cfif isDefined("url.start")>
   <cfset iStartRow=#url.iStartRow#+5>
   <cfif iStartRow gt query.recordCount>
      <cfset iStartRow=1>
   </cfif>
<cfelse>
    <cfset iStartRow=1>
</cfif>
<cfoutput><meta http-equiv="Refresh" content="5;URLpage.cfm?start=#iStartRow#"><cfoutput>



<table>
 <tr>
 <td> Messages have been rececived for the following</td>
 </tr>
<cfoutput query="get_mess" startrow="#iStartRow#" maxrows="10"><tr>
 <td width="81%" valign="top" align="left">#Message_for# Rec: #timeformat(message_date,"hh:mm tt")# #message_company#<br>
 </td>
</tr>
</cfoutput>


</table>

0
James RodgersWeb Applications DeveloperCommented:
this line

<cfif iStartRow gt query.recordCount>

should be

<cfif iStartRow gt get_mess.recordCount>
 i put the query.recordcount as a spacer

ok try this

<cfquery name="get_mess" datasource="noticias">
Select * from news
</cfquery>

<cfif not isDefined("url.start")>
  <cfset iStartRow=1>
<cfelse>
   <cfif url.start gt get_mess.recordCount>
      <cfset iStartRow=1>
   </cfif>
</cfif>
<cfoutput>
<meta http-equiv="Refresh" content="30;URLpage.cfm?start=#evaluate('#iStartRow#'+45)#">
</cfoutput>


<table>
 <tr>
 <td> Messages have been rececived for the following</td>
 </tr>
<cfoutput query="get_mess" startrow="#iStartRow#" maxrows="45"><tr>
 <td width="81%" valign="top" align="left">#Message_for# Rec: #timeformat(message_date,"hh:mm tt")# #message_company#<br>
 </td>
</tr>
</cfoutput>


</table>
0
James RodgersWeb Applications DeveloperCommented:
left a line out


<cfquery name="get_mess" datasource="noticias">
Select * from news
</cfquery>

<cfif not isDefined("url.start")>
  <cfset iStartRow=1>
<cfelse>
   <cfif url.start gt get_mess.recordCount>
      <cfset iStartRow=1>
   <cfelse>
       <cfset iStartRow=#url.start#>
   </cfif>
</cfif>
<cfoutput>
<meta http-equiv="Refresh" content="30;URLpage.cfm?start=#evaluate('#iStartRow#'+45)#">
</cfoutput>


<table>
 <tr>
 <td> Messages have been rececived for the following</td>
 </tr>
<cfoutput query="get_mess" startrow="#iStartRow#" maxrows="45"><tr>
 <td width="81%" valign="top" align="left">#Message_for# Rec: #timeformat(message_date,"hh:mm tt")# #message_company#<br>
 </td>
</tr>
</cfoutput>


</table>
0
jriver12Author Commented:
still receiving the same recordset.

<cfquery name="get_mess" datasource="noticias">
Select * from news
</cfquery>

<cfif not isDefined("url.start")>
  <cfset iStartRow=1>
<cfelse>
   <cfif url.start gt get_mess.recordCount>
      <cfset iStartRow=1>
   <cfelse>
       <cfset iStartRow=#url.start#>
   </cfif>
</cfif>
<cfoutput>
<meta http-equiv="Refresh" content="5;URLpage.cfm?start=#evaluate('#iStartRow#'+10)#">
</cfoutput>


<table>
 <tr>
 <td> Messages have been rececived for the following</td>
 </tr>
<cfoutput query="get_mess" startrow="#iStartRow#" maxrows="10"><tr>
 <td width="81%" valign="top" align="left">#Message_for# Rec: #timeformat(message_date,"hh:mm tt")# #message_company#<br>
 </td>
</tr>
</cfoutput>


</table>
0
James RodgersWeb Applications DeveloperCommented:
sorry typo

try this as teh meta tag

<meta http-equiv="Refresh" content="30;url=URLpage.cfm?start=#evaluate('#iStartRow#'+45)#">
0
anandkpCommented:
I guess using CFFLUSH wld help here

read help on it & try it out !
0
hartCommented:
ok how about this

<cfparam default="1" name="iStartRow">

<cfquery name="get_mess" datasource="noticias">
Select * from news
</cfquery>

<cfif iStartRow gte get_mess.RecordCount>
  <cfset iStartRow = 1>
</cfif>

<HTML>
<HEAD>
<meta http-equiv="Refresh" content="30;url=pagename.cfm?iStartRow =<cfoutput>#evaluate(iStartRow+45)#</cfoutput>">
</HEAD>
<BODY>
<table>
<tr>
<td> Messages have been rececived for the following</td>
</tr>
<cfoutput query="get_mess" startrow="#iStartRow#" maxrows="45"><tr>
<td width="81%" valign="top" align="left">#Message_for# Rec: #timeformat(message_date,"hh:mm tt")# #message_company#<br>
</td>
</tr>
</cfoutput>
</table>
</BODY>
</HTML>


let me know

Regards
Hart
0
hartCommented:
there will be space in between iStartRow =<cfoutput>#
kindly remove it and make it to iStartRow=<cfoutput>#
in the meta tag

Regards
Hart
0
James RodgersWeb Applications DeveloperCommented:
here is the complete code bu tin the meta tag you really should have a value greater that 5, that value is the number of seconds until the page refreshes, go with 30 or at least 20

<cfquery name="get_mess" datasource="noticias">
Select * from news
</cfquery>

<cfif not isDefined("url.start")>
  <cfset iStartRow=1>
<cfelse>
   <cfif url.start gt get_mess.recordCount>
      <cfset iStartRow=1>
   <cfelse>
       <cfset iStartRow=#url.start#>
   </cfif>
</cfif>
<cfoutput>
<meta http-equiv="Refresh" content="5;url=URLpage.cfm?start=#evaluate('#iStartRow#'+10)#">
</cfoutput>

<table>
 <tr>
 <td> Messages have been rececived for the following</td>
 </tr>
<cfoutput query="get_mess" startrow="#iStartRow#" maxrows="10"><tr>
 <td width="81%" valign="top" align="left">#Message_for# Rec: #timeformat(message_date,"hh:mm tt")# #message_company#<br>
 </td>
</tr>
</cfoutput>

</table>
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
jriver12Author Commented:
Jester_48
Thanks for the insight on the meta time I had set it to 5 because I did not want to wait during testing.  However the last correction on the meta worked flawlessly. thanks for the assistance and time with this code.
0
jriver12Author Commented:
Thanks to all to have participated in this thread your assistance is and always will be greatly appreciated.

Thanks again.
0
James RodgersWeb Applications DeveloperCommented:
np...
glad i could help

i apologize for the typos, can't type worth a damn, kind of a bad thing for someone in my job

;-)
0
James RodgersWeb Applications DeveloperCommented:
thanks for the points
0
jriver12Author Commented:
I Feel You Pain.

And your welcome, would have offered more but EE limits me.

;^0
0
James RodgersWeb Applications DeveloperCommented:
>>would have offered more but EE limits me
thanks
but ,hey... no worries
0
hartCommented:
did u even try my post it was more simplified ???

Regards
Hart
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Servers

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.