RE: [PHP] php query for mysql table

From: Date: Mon, 20 Aug 2001 17:13:12 +0000
Subject: RE: [PHP] php query for mysql table
Groups: php.general 
Request: Send a blank email to php-general+get-63535@lists.php.net to get a copy of this message
Wolfgang, Use LIKE '%life%' as in SELECT somecolumn FROM mytable WHERE LOWER(mycolumn) LIKE '%life%' Don't forget to compare same case strings. Johan Alfredeen www.pongworld.com From mySQL manual: mysql> SELECT * FROM tbl_name WHERE set_col LIKE '%value%'; mysql> SELECT * FROM tbl_name WHERE FIND_IN_SET('value',set_col)>0; -----Original Message----- From: Wolfgang Schneider [mailto:schneider@bibelcenter.de] Sent: Monday, August 20, 2001 4:22 AM To: php-general Subject: [PHP] php query for mysql table 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 (#63535) next »