Dear John,

probably the problem does not derive from MySQL, but from the URL encoded
search string, e.g.:

Search for "oneword" => oneword

Search for "two words" => two%20words

If you match against "two words", there will be no match, as it should match
against "two%20words".

I am not informed which language you use for your application. If it's PHP,
you can use the urldecode() function which will convert "%20" into " ", so
you can feed MySQL with the decoded string.

Hope it helps,
--
  Stefan Hinz <[EMAIL PROTECTED]>
  CEO / Geschäftsleitung iConnect GmbH <http://iConnect.de>
  Heesestr. 6, 12169 Berlin (Germany)
  Telefon: +49 30 7970948-0  Fax: +49 30 7970948-3


----- Original Message -----
From: "John Chang" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, November 25, 2002 8:20 PM
Subject: Select statement problem


> I am creating a search form for the TitleName.  When I type in one word it
> finds all titles with the one word.  If I use two words it doesn't work.
> How do I change my select statement to make it work?  Thank you.
>
> SELECT *
> FROM Titles A, ActorTitle B, Actors C
> WHERE A.TitleID=B.TitleID AND B.ActorID=C.ActorID AND A.TitleName LIKE
> '%Title%'
> GROUP BY A.TitleName ASC
>
> Studios (StudioName, StudioID)
> Genres (GenreName, GenreID)
> Titles (VideoTitle, Details, StudioID, GenreID, BitRateID, TitleID)
> Actors (Name, ActorID)
> ActorTitle (TitleID, ActorID)
> TitleGenres (TitleID, GenreID)
>
> MYSQL
>
>
> ---------------------------------------------------------------------
> Before posting, please check:
>    http://www.mysql.com/manual.php   (the manual)
>    http://lists.mysql.com/           (the list archive)
>
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail
<[EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
>


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to