gaza165 Posted June 2, 2009 Share Posted June 2, 2009 I am trying to look for these words in a record in my table [url [img [b something like that but this doesnt work Code: [select] $message = mysql_query("SELECT * FROM chat WHERE message IN ('[url','[b','[img') AND chat_id = $lastid "); Quote Link to comment https://forums.phpfreaks.com/topic/160661-searching-for-words-in-a-table-sql/ Share on other sites More sharing options...
gevans Posted June 2, 2009 Share Posted June 2, 2009 Don't just start an identical post http://www.phpfreaks.com/forums/index.php/topic,254933.0.html Quote Link to comment https://forums.phpfreaks.com/topic/160661-searching-for-words-in-a-table-sql/#findComment-847866 Share on other sites More sharing options...
gaza165 Posted June 2, 2009 Author Share Posted June 2, 2009 I just really want to know about this is it taking [ as part of it? Quote Link to comment https://forums.phpfreaks.com/topic/160661-searching-for-words-in-a-table-sql/#findComment-847869 Share on other sites More sharing options...
Mark Baker Posted June 2, 2009 Share Posted June 2, 2009 is it taking [ as part of it?No, it's because you don't know the difference between IN and LIKE SELECT * FROM chat WHERE (message LIKE '%[url%' OR message LIKE '%[b%' OR message LIKE '%[img%') AND chat_id = $lastid Quote Link to comment https://forums.phpfreaks.com/topic/160661-searching-for-words-in-a-table-sql/#findComment-847898 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.