On 5/4/05, Bruno Lustosa <[EMAIL PROTECTED]> wrote:
> On 5/3/05, Gordon Stewart <[EMAIL PROTECTED]> wrote:
> > LIKE '%$SEARCHTEXT%'

> Though using LIKE (or ILIKE) isn't much good for large databases, you
> could always change spaces into '%', so if you do a LIKE '%LA%678%',
> it should pick up both fields.
> Just beware using LIKE, because as the database grows, so will your search 
> time.

Hmm However thats ONLY good if ive hard-coded LA%678 into the search....

Hmmm - Might do a few preg-match / Preg-replace- It could be done - Thanks....

hmm Did a quick test - & its going :)

if (preg_match("/^\s*(\w+.*?\D)\s*(\d+\d*?)\s*$/i", $SEARCHTEXT,$matches)){
$SEARCHTEXT="$matches[1]%$matches[2]";
}
echo "DOING SEARCH - '$SEARCHTEXT'<BR>\n";

Basically - If the search is leters/numbers - With or without  a space
- Then it inserts the %

Thanks...

- Off to bed :-)

-- 

G Stewart
NZ: [EMAIL PROTECTED]
NZ Bus Website update form
http://busnz.kwister.com/feedback.php


Community email addresses:
  Post message: [email protected]
  Subscribe:    [EMAIL PROTECTED]
  Unsubscribe:  [EMAIL PROTECTED]
  List owner:   [EMAIL PROTECTED]

Shortcut URL to this page:
  http://groups.yahoo.com/group/php-list 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/php-list/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to