Re: php query for mysql table

From: Date: Mon, 20 Aug 2001 11:33:50 +0000
Subject: Re: php query for mysql table
Groups: php.general 
Request: Send a blank email to php-general+get-63490@lists.php.net to get a copy of this message
select * from yourtable where question like '%life%' ---------- Original Message ---------------------------------- From: "Wolfgang Schneider" <schneider@bibelcenter.de> Reply-To: "Wolfgang Schneider" <schneider@bibelcenter.de> Date: Mon, 20 Aug 2001 12:22:15 +0200 >Hi > >I am a newbie to php + mysql and wanted to ask for some help on a >particular item which I can't seem to find "the right key" in the >documentation. I am trying to set up a simple Q&A system with an entry >page where one can select to either have all questions & answers from a >mysql database displayed or else search with a text field for only >those questions which contain a certain word(s). > >Can someone tell me how to set in a query when trying to find records >in a mysql table that have a certain word or perhaps 2 or 3 words >(among others) ...? > > I know about using SELECT and WHERE in order to find records which >match *exactly*, but am looking for something a bit different ... > >Example: >The values of 3 records for the "question" field of the database might >be the following: > >[1] How do you deal with anger? >[2] Ever been full of anger in your life? >[3] Is life always easy? > >How can I set a PHP query with SELECT and WHERE to express the >following: > >Which questions contain the word "life"? That is, have someone search >the database in the "question" field for records where the word "life" >is used as part of the question ... The result then should return the >records 2 & 3 above > >Any help is greatly appreciated. Thanks mucho. >God bless you with His grace and peace >Wolfgang > >Looking for Biblical information? COME AND SEE! >-- ONLINE Courses: http://classes.bibelcenter.de ... NEW! >-- BibelCenter: http://www.bibelcenter.de >-- Bookstore: http://www.worthy.net/BibelCenter/ > > > > >-- >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 > >

« previous php.general (#63490) next »