Re: MySQL search

From: Date: Fri, 11 Aug 2000 15:32:34 +0000
Subject: Re: MySQL search
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-11343@lists.php.net to get a copy of this message
thanks, nick, that should help considerably. Regards. On Fri, 11 Aug 2000, Nick Talbott wrote: > Date: Fri, 11 Aug 2000 16:28:40 +0100 > To: <tyler.longren@midiowa.net> > From: "Nick Talbott" <nickt@powys.gov.uk> > Subject: Re: [PHP] MySQL search > > Hi, Tyler > > To get you started, you need to be using 'LIKE' in a 'WHERE' clause. > > eg select ... (whatever) ... where column like '%this%' > > In a LIKE expression, the percent is a wildcard, so this example finds > the > sequence 'this' anywhere in the field. (% matches zero or more > characters.) > > So to search for a variable $var at any position in one of a number of > columns your SQL might be something like > > .... where columnA like '%$var%' or columnB like '%$var%' or ... > > Does this give you enough to get going? > > Regards - Nick > > Nick Talbott > IT Policy and Strategy Manager, Powys County Council, UK > > email nickt@powys.gov.uk > FAX +44 (0) 1597 824781 > web http://www.powys.gov.uk and > http://www.powysweb.co.uk > > > > -----Original Message----- > From: Tyler Longren <tyler.longren@midiowa.net> > To: PHP-General <php-general@lists.php.net> > Date: 11 August 2000 15:28 > Subject: [PHP] MySQL search > > > >Hi everybody, > > > >I'm having some troubles setting up a search script to search through 3 > >fields in a MySQL table. Can somebody help me out? I don't know how I > >should even go about it. Thanks. > > > > > >Regards, > >-- > >Tyler Longren > >[Web Development] > >Premier Visual Services > >http://www.pvs2000.com > > > > > >-- > >PHP General Mailing List (http://www.php.net/) > >To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > >For additional commands, e-mail: php-general-help@lists.php.net > >To contact the list administrators, e-mail: php-list-admin@lists.php.net > > > > > > -- Tyler Longren [Web Development] Premier Visual Services http://www.pvs2000.com

« previous php.general (#11343) next »