List:General Discussion« Previous MessageNext Message »
From:BÁRTHÁZI András Date:February 22 2006 5:55am
Subject:Re: Creating a Web Database Search Application
View as plain text  
Hi,

> With so few fields, sticking with one report isn't
> out of the question. Don't know if you're using
> this technique:
> 
> my $lname = $q->param('lname') || '%';
> 
> So all fields not filled/selected by the user are
> wildcards by default.  A completely empty form
> pulls all data in the relevant tables.

Hmm, doing a

  ... column-name LIKE '%' ...

isn't slower than including nothing?

I mean (warning!, no escaping):

   push @where, "lname LIKE '$lname'"
     if $lname;

And:

   $where = '';
   $where = "WHERE ".join(' AND ', @where)
     if @where;

Bye,
   Andras

Thread
Creating a Web Database Search ApplicationDouglas S. Davis21 Feb
  • Re: Creating a Web Database Search ApplicationJonathan Mangin21 Feb
  • Re: Creating a Web Database Search ApplicationJonathan Mangin22 Feb
    • Re: Creating a Web Database Search ApplicationBÁRTHÁZI András22 Feb