Re: Search Database !

From: Date: Sun, 16 Jun 2002 21:20:56 +0000
Subject: Re: Search Database !
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-102424@lists.php.net to get a copy of this message
On Sun, Jun 16, 2002 , Septic Flesh <septic_flesh@hotmail.com> wrote: > select * from products where %prod_name% like %ATX% > try select * from products where prod_name like '%ATX%' > > this is wrong . .I try to execute it in the mysql through myphpadmin and I > got error .. > > y ? > > what do I miss ? > > > -- > ~~~~~~~~~~~~~~~~ > > Sapilas@/dev/pinkeye > > ~~~~~~~~~~~~~~~~ > "Chris Shiflett" <shiflett@php.net> wrote in message > news:3D0CF68C.5090603@php.net... > > select * from products where prod_name like '%your_word%' or description > > like '%your_word%'; > > > > Replace "*" with whatever you are searching for *or leave it if you want > > everything), and replace "your_word" with whatever term you are > > searching for. > > > > Chris > > > > Septic Flesh wrote: > > > > >How can I do the following ? > > > > > >I have the following database: > > > > > >Products > > >====== > > >cat_id > > >prod_id > > >prod_name > > >description > > >manu_name > > > > > > > > >The user is going to put a word as input, and I wanna search this word in > > >the database. > > > > > >How do I make this QUERY to search for some letters (the given word) in > the > > >"prod_name" field or in the "description" field ? > > > > > > > > >Thanks in advance ? > > > > > > > > > > > > > > > > > >-- > > >~~~~~~~~~~~~~~~~ > > > > > >Sapilas@/dev/pinkeye > > > > > >~~~~~~~~~~~~~~~~ > > > > > > > > > > > > > > > > > > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Dave Barry - (no, not that one) Don't believe in the system. dave@mikamyla.com --Michael Franti

« previous php.general (#102424) next »