CF has ceiling(), int() [commonly called floor()], fix(), and round() for
returning integer number (input upto to real set).
<cfset pages = ceiling(query.recordCount / max_rows)>
I'd suggest you read through the language reference a few times; this will
familiarise you with CFs tags, functions, and general syntax. If you're new
to programming or scripting in general you might want to read some
programming logic books first.
Hope this helps,
Raymond B.
BTW, nice Flash intro on your site.
-----Original Message-----
From: W Luke [mailto:[EMAIL PROTECTED]]
Sent: January 21, 2001 06:32
To: CF-Talk
Subject: Re: Basic Search Engine
Thanks for that - very informative.
On the subject of finding out how many pages in the search results there
are, does anyone have any tips? The furthest I've got is to do the
following:
<Cfset nopages = (get_results.recordcount / max)>
This, for example, gives results of 0.4 and 2.5 - what I need to do then is
round them up or down. Any ideas?
Cheers,
Will
>
> this is a very good article
> http://www.defusion.com/articles/index.cfm?ArticleID=81
>
>
>
> At 08:59 pm 21/01/01 , you wrote:
> >Hi,
> >
> >I'm building a basic search engine to query a table in my Database, and
> >return 10 results at a time. At the moment I've got URL parameters of
> >url.query and url.start_row and a variable #maxrows# set to 10 - if no
> >inital start_row is defined, then the startrow is 1. I was wondering the
> >best way to do the following "features" of a search engine.
> >
> >* When and how to display a "previous" link. What I mean by this is for
the
> >first 1-10 results, we don't need a "previous results" link.
> >* How to determine number of pages in the search. E.g. if there are 48
> >results, and maxrows is set to 10, then there should be 4 pages.
> >
> >Any hints or tips appreciated.
> >
> >Will
> >--
> >[EMAIL PROTECTED] -=- www.lukrative.com
> >Classifieds -=- www.localbounty.com
> >
> >
> >
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists