Jump to content

can i search for individual words throughout a text entry?


jwk811

Recommended Posts

when i submit a piece of date to a database as a text column would i be able to later then search for individual words in it? like the text will include many different words separated by commas and when i search through that column of all the entries it will show the entire text box because it found just one of them.. lol i hope that makes sense to you, thanks for any help!
heres my code.. its not working..unexpected T_VARIABLE error


[code]if(isset($_POST['find_word'])){
$word = $_POST['word'];
$word = 'Hich';
$sql = "SELECT * FROM dictionary WHERE word  LIKE '%$word%'"
$result = dbQuery($sql);
}
else{
$sql = "SELECT id, word, pro, pro2, pos, sub, trans, def, ex, date
        FROM dictionary $where
ORDER BY word";
$result = dbQuery($sql);
}

while($row = dbFetchAssoc($result)) {
extract($row);
}[/code]
and this code is basically saying.. if they requested to find a specific word show only that word otherwise display them all.. and ive tried a bunch of things but i cant figure it out

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.