|
| |
|
|
proper
Posts: 14 Joined: 1/5/2002 From: United Kingdom Status: offline
|
>1 page of results stored in array..? - 2/12/2003 19:00:04
I am retrieving > 1 page of results from the DB (page size is set to 5). Presumably the SQL is executed and the results stored in an array somewhere..... Can I see the code that carries out the table loops to produce 5 on a page (is it inside the mysterious include statements?) My code produces the first page fine and then appears to go back and execute the SQL again (without the form data so different results) before displaying page 2. Also sometimes starts on page 2. I don' t appear to be able to put an IF statement around the SQl code (ie to say if first time thru then execute otherwise don' t and to set abspage to 1 first time thru) - do I need to do this or should the FP code be handling this when I chose 5 recs per page (bit concerned I' ve lost something when administering the spooky diet!) Thanks
|
|
|
|
proper
Posts: 14 Joined: 1/5/2002 From: United Kingdom Status: offline
|
RE: >1 page of results stored in array..? - 2/13/2003 18:01:56
Basically a user has the opportunity to select several criteria that must be present for a holiday on a form page and this is used to query an Access DB (within the Web). If a criteria is checked then the record will only be selected if the criteria is present on the DB rec. If a criteria is not checked that doesn' t necessarily exclude the record from selection. No criteria checked will return all recs on the DB (up to a defined limit) Given that there could potentially be lots of records returned, I want to display 5 recs on a page. I used the DB Results wizard to do this and then used the spooky diet on the code because I wanted to use SQL which wasn' t allowed by custom query in FP (it uses variables I create as well as form fields). I want to be able to see what is actually happening when it handles the 6th record (ie start of 2nd page of results) because it goes from displaying 5 to 6 of 6 recs on page 1 (correctly) to displaying 6 - 10 of 10 recs on page 2 (rather than 6 - 6 of 6 recs).
|
|
|
|
proper
Posts: 14 Joined: 1/5/2002 From: United Kingdom Status: offline
|
RE: >1 page of results stored in array..? - 2/19/2003 9:56:50
Thanks for that reference - certainly have to try that if I can' t get this to work, tho' I' m not quite sure how I' d incorporate it into what I' ve already got ie do I leave out the include statements - all 3 of them? Anyway here is the code in case you can spot something glaringly obvious... Thanks <body> <table width=" 100%" ><hr> <tbody> <!--#include file=" _fpclass/fpdblib.inc" --> <% if 0 then %> ....stuff about needing to be asp........ <% end if %> <% fp_sQry=" SELECT statement....... fp_sDefault=" " fp_sNoRecords=" No records have been found which match your search criteria - try altering the criteria" fp_sDataConn=" HolidayDB1" fp_iMaxRecords=256 fp_iCommandType=1 fp_iPageSize=5 fp_fTableFormat=True fp_fMenuFormat=False fp_sMenuChoice=" Name" fp_sMenuValue=" Name" fp_iDisplayCols=4 fp_fCustomQuery=True BOTID=0 fp_iRegion=BOTID %> <!--#include file=" _fpclass/fpdbrgn1.inc" --> <% rcount=fp_rs.RecordCount %> <tr> <td height=40 width=150><font size=" 2" color=blue><%=FP_FieldVal(fp_rs," Name" )%></font></td> <td height=40 width=100><font size=" 2" > </font><font size=" 2" color=" blue" ><%=FP_FieldVal(fp_rs," Address" )%></font></td> <td height=40 width=160><font size=" 2" > </font><font size=" 2" color=" blue" ><%=" <a target=_blank href=" " " & FP_FieldLink(fp_rs," Website" ) & " " " >" & FP_FieldVal(fp_rs," Website" ) & " </a>" %></font></td></tr> <tr><td height=40 valign=top colspan=4><font size=" 2" color=#FF9C4A><%=FP_FieldVal(fp_rs," Description" )%></font></td></tr> <!--#include file=" _fpclass/fpdbrgn2.inc" --> </tbody> </table><hr> <% if not fp_fError AND (fp_iAbsPage*fp_iPageSize)-(fp_iPageSize-1) >0 then response.write " Displaying " & (fp_iAbsPage*fp_iPageSize)-(fp_iPageSize-1) & " -" & ((fp_iAbsPage*fp_iPageSize)-fp_iPageSize)+(fp_iCount) & " of " & rcount & " items." end if %> </body></html>
|
|
New Messages |
No New Messages |
Hot Topic w/ New Messages |
Hot Topic w/o New Messages |
Locked w/ New Messages |
Locked w/o New Messages |
|
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts
|
|
|