This is all down to the database query code for your search. You can make
your query return all records if the id is 0 with something like this:
<cfparam name="form.id" default="0">
<cfquery name="search" datasource="#ds#">
SELECT stuff
FROM someTable
WHERE 1 = 1
<cfif form.id GT 0>
AND stuffId = <cfqueryparam cfsqltype="cf_sql_integer"
value="#form.id#">
</cfif>
</cfquery>
Basically, if the database sees 'WHERE stuffId = 0' it will only return a
result if there is a record with an id of 0. You need to include the clause
if you don't want a filter on the id field.
HTH
Dominic
On 18/02/2008, Ali <[EMAIL PROTECTED]> wrote:
> Hi:
> I'm making a search engine but I want the search result page has all the
> records before the user filters them. I want the user to be able to search
> through the IDs too and IDs are autonumber fields. When I set CFPARAM I
> have
> to use a Number variable as default and it's impossible to set is as ""
> the
> way string variables can be set. Is it possible to set it somehow that I
> set
> my default IDs variable that it returns all the records at first the way
> Default = "" does it for string variables?
> Thanks
> Ali
>
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:299259
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4