Re: Partly matching a field (Slightly 0T)
| From: | Curt Zirzow | Date: | Thu, 15 Apr 2004 00:08:41 +0000 |
| Subject: | Re: Partly matching a field (Slightly 0T) | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-183395@lists.php.net to get a copy of this message | ||
* Thus wrote Robert Cummings (robert@interjinn.com):
> On Wed, 2004-04-14 at 19:45, Ryan A wrote:
> > Hi,
> > I have a field "client_id" in the database and I have a search from where
> > the client can enter the client_id to match from the database and then
> > return the accounts details.
> >
> > Later on we had to tack a --<crap> after the client id,
> > eg: if the original client id was:
> > sadf_234
> >
> > after the "tack" it becomes:
> > sadf_234--abcdef
> >
> > The client of course does not know about the extra bits we have added as its
> > for some internal functions, all he will do a
> > search on is sadf_234
> >
> > I have tried to do this using the LIKE condition in my SQL statement but I
> > think I got the syntax a bit wrong coz its not working....
> >
> > Feeling totally braindead...a little help appreciated.
>
> ...
> WHERE client_id LIKE 'sadf_234%'
> ...
might want to look up to the --, in case there is a client with
sadf_2345.
WHERE client_id LIKE 'sadf_234--%'
Curt
--
"I used to think I was indecisive, but now I'm not so sure."