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!
Link to comment
Share on other sites

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
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.