$word = 'bingo'; $sql = "SELECT a_column FROM table WHERE text_column LIKE '%$word%'; $res = mysql_query($sql); // etc... for displaying results
Resuming: % on the beggining - doesn't matter what comes before % on the end - doesn't matter what comes after -- Julio Nobrega No matter where you go, &this. "Michael Hall" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > > How can I search a MySQL database field that contains sentences (VARCHAR > datatype) or entire texts (TEXT datatype) for single words? > > Let's say I want to search 100 articles stored in a database field as TEXT > for the word "bingo", is there any SQL or PHP way of doing that? > > Mick > > -- > ################################ > Michael Hall > [EMAIL PROTECTED] > [EMAIL PROTECTED] > http://openlearningcommunity.org > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]