|
| |
|
|
markjlawrence
Posts: 119 From: Belfast Northern Ireland Status: offline
|
Include record count in Select query - 4/21/2001 20:06:00
Hi,I have a form that posts its results to a second page where the results are displayed. I would like to display the number of records returned (displayed at the top of the page). I can create this using DRW, however that will mean that 2 connections will be made to the database. Is there any way to incorporate this record count into the SQL query along with the SELECT table.* WHERE .... etc. to make one query return the results and the record count? Thanks, Mark.
|
|
|
|
Spooky
Posts: 26606 Joined: 11/11/1998 From: Middle Earth Status: offline
|
RE: Include record count in Select query - 4/21/2001 22:24:00
The easiest way it to use <%=fp_iCount%> (from memory)This is a count from the SQL string that exists, but is only available after processing the DRW
------------------ Spooky "I am Spooky of Borg. Prepare to be assimilated, babycakes!" Subscribe to OutFront News Database / DRW Q & A The Spooky Login!
|
|
|
|
markjlawrence
Posts: 119 From: Belfast Northern Ireland Status: offline
|
RE: Include record count in Select query - 4/22/2001 20:16:00
Brilliant! That's just what I need!Thanks Spooky :-)
|
|
|
|
Stuart at Cherry
Posts: 121 From: Leeds, West Yorkshire, UK Status: offline
|
RE: Include record count in Select query - 4/25/2001 20:42:00
Mark,I've got a recruitment site that pulls up all the vacancies from a database. I too would like to put something at the top such as "There are x vacancies on this search". I think this is what you were asking, and you seem pleased with the response, but I don't understand. Where do you put the "<%=fp_iCount%>"? Thanks in anticipation....
|
|
|
|
Mojo
Posts: 2441 From: Chicago Status: offline
|
RE: Include record count in Select query - 4/25/2001 20:10:00
<%fp_iCount%> only works after the DRW has done its work. You will not be able to have your record number above the actual results.If that is not a problem then it works great. Another Spooky success! Joe
|
|
|
|
markjlawrence
Posts: 119 From: Belfast Northern Ireland Status: offline
|
RE: Include record count in Select query - 4/25/2001 15:06:00
Good point jbennett, I haven't got as far as trying it out. I assumed that I could set a variable = to the <%=fp_iCount%> and then display it on the page. Don't ask me about the syntax, I was hoping to pick that up as I go along. If you have figured it out, let me know.Mark.
|
|
|
|
Spooky
Posts: 26606 Joined: 11/11/1998 From: Middle Earth Status: offline
|
RE: Include record count in Select query - 4/25/2001 17:43:00
The fp_icount does not become active until the include page fpdbrgn2 has been read.So the variable will only be active after that part of the page (which is below the DRW) So renaming it etc wont work as it will be null. btw the "=" is shorthand for Response.write if you wanted to know  So the icount is my best suggestion, as I dont like suggesting that another dtabase call is made on the same page, just for a record count.
|
|
|
|
jessecan
Posts: 109 From: Aliso Viejo, CA Status: offline
|
RE: Include record count in Select query - 5/15/2001 14:16:00
Hello,I would like to use this parameter but do not know where to insert it. Do you put it into the custom query or what. I have tried to put it into the HTML but FP will not let it stay without rewriting it to the way that it was. Can anyone help? Thank you in advance!
|
|
|
|
Mojo
Posts: 2441 From: Chicago Status: offline
|
RE: Include record count in Select query - 5/15/2001 20:44:00
On your DRW page... It has to go after the DRW and before the end of the grey code.This is what we were talking about in the above posts. You will not be able to have the record count displayed at the top of the page using this method. Other than that, it works great. Joe
|
|
|
|
jessecan
Posts: 109 From: Aliso Viejo, CA Status: offline
|
RE: Include record count in Select query - 5/16/2001 20:22:00
Joe,I still cannot figure out where to insert this script. I have tried inserting it everywhere after the red code and before the end of the grey code. When I do insert it in a place that FP will let it be, it results in an error when I try and run it. Can anyone lend me further assistance?
|
|
|
|
Spooky
Posts: 26606 Joined: 11/11/1998 From: Middle Earth Status: offline
|
RE: Include record count in Select query - 5/16/2001 20:35:00
Try (in HTML view) placing the code just before the closing body tag:<%=fp_iCount%> </body> </html> Make sure though, that you cut and paste this into notepad first, then in to frontpage
|
|
|
|
Dealer58
Posts: 174 From: New York (was in Germany) Status: offline
|
RE: Include record count in Select query - 6/12/2001 18:51:00
Hi GangI also have the <%=fp_iCount%> toward the end of the page. It gives me the count as well. However, I have the DRW set to return only 25 rows at a time. If there are 100 rows returned in total it only shows a count of 25 each time!! So...that is not the actual count of the query. I guess the only way to get an actual count with this method is to return the entire search on one page. What if you have a couple of thousand rows of fields to return? The user would be scrolling all the way down to(well, you know where!)  I just found another count method on this site (I didn't see this before, maybe I missed it) It looks like Spooky's handwork and if I'm not mistaken this count is taking place before the fpdbrgn2 has been read. I haven't tried it yet but is this returning the same type of count requested in this thread? Here's what I'd like to do. First of all I would also like to return the entire query count before the DRW. I am not looking to return every item in the table, only the ones the search finds. I stumbled on a website that was built with FP. He has the query count the way I just explained it. I cannot see how he did it but maybe Spooky can see through this. I do not have the link right in front of me now. Spooky, I'll get it some how in the next 8-10 hours and email it to you. (I'm on the road right now using Hotel PC's) Regards CC
|
|
|
|
Dealer58
Posts: 174 From: New York (was in Germany) Status: offline
|
RE: Include record count in Select query - 6/14/2001 20:22:00
Spooky,The reason why I think its a DRW is because if you look at the source it is has FrontPage criteria all over it. I'm sure the site is based on Front Page. Furthermore, looking a the source, it has <!--webbot bot="HTMLMarkup" startspan --> <!--webbot bot="HTMLMarkup" endspan --> all over it. From my amatuer point of view (and I could be wrong) this tells me that it is a DRW and its not even on a diet. Because it looks similar to one of my pages that has a DRW looking at the source (Was this a test? Did I pass?)  CC
|
|
|
|
Mojo
Posts: 2441 From: Chicago Status: offline
|
RE: Include record count in Select query - 6/14/2001 20:55:00
After looking through that page I don't see how you can tell it is using the DRW.In fact I am sure they are *NOT* using the DRW. Look: <INPUT TYPE="HIDDEN" NAME="nextCatNo" VALUE="205"> <INPUT TYPE="HIDDEN" NAME="nextTitle" VALUE=""> <INPUT TYPE="HIDDEN" NAME="total" VALUE="35"> <INPUT TYPE="HIDDEN" NAME="Cat" VALUE="205"> <INPUT TYPE="HIDDEN" NAME="currentPage" VALUE="1"> They are passing the page number, total items found and other information through hidden fields in the form. This is how they are maintianing state. FP does not do it like this. Heck, they are passing the SQL query string through hidden fields. If you go further, you will see they are passing everything, even the *PRICE* through hidden fields. This is a custom job. It looks like an out of the box ecommerse package. If they are not doing an HTTP_REFERER check on their site you may be able to buy everything for a $1... or less. They could get spoofed and the REFERER check may not even matter. Joe
|
|
|
|
Dealer58
Posts: 174 From: New York (was in Germany) Status: offline
|
RE: Include record count in Select query - 6/14/2001 18:58:00
This is why I like this place!  I think you guys are the BEST there is. Honestly. Everything cut, dry and to the point. Like I said, I'm an amature. I am learning here, perhaps by hitting and missing, but in the end the most important thing prevails. I'm learning how to get things done the right way. About 4 months ago I didn't even know what <html> meant! Thanks Again  CC PS I think this is the 3rd or 4th thread I've burned. Sorry!
|
|
|
|
hzarabet
Posts: 1540 From: New Milford CT USA Status: offline
|
RE: Include record count in Select query - 6/15/2001 20:54:00
I am just skimming this thread so I may have missed the obvious, but I run a count on my database results page. I just set up a second DRW using COUNT and then put it on a diet.http://www.signingshotline.com/search.asp Fill in a search and you'll see. ------------------ www.Signingshotline.com lists EVERY upcoming athlete autograph appearance in the US and Canada
|
|
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
|
|
|