RE: More problems with searching

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 01 July 2004 20:02, Shiloh Madsen wrote:

> What technique would you suggest to accomplish the same thing?

Well, personally I'd tend to use the flag-the-first-pass method, which suppresses the addition of the AND or OR the first time through the build loop (I think someone else posted an example of this to the list).  But both ways can be considered valid approaches -- it just depends on what seems better (or more elegant, if you like!) to you.

> ----- Original Message -----
> From: "Ford, Mike [LSS]" <M.Ford@xxxxxxxxxxxxxx>
> 
> > On 01 July 2004 18:36, Justin Patrin wrote:
> > 
> > > On Thu, 1 Jul 2004 12:28:46 -0500, Shiloh Madsen
> > > <shiloh_madsen@xxxxxxxxxxxxxxx> wrote:
> > > > 
> > > > 
> > > > this was Mr Holmes's solution (in part):
> > > > $query = "SELECT * FROM keyword WHERE 1 "
> > > > $words = explode(' ',$_GET['search_text']);
> > > > foreach($words as $word)
> > > > { $query .= " AND keyword = '$word' "; }
> > > 
> > > Shouldn't that be OR?
> > 
> > ... and, if it should, that should be a 0 instead of a 1
> (although I'm not
> a huge fan of this technique!).

Cheers!

Mike

---------------------------------------------------------------------
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Headingley Campus, LEEDS,  LS6 3QS,  United Kingdom
Email: m.ford@xxxxxxxxxxxxxx
Tel: +44 113 283 2600 extn 4730      Fax:  +44 113 283 3211 

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux