graham23s Posted June 23, 2007 Share Posted June 23, 2007 Hi Guys, on my forum there is an ability to search previous posts, but the way it is now it only searches 1 table in mysql "forum_posts" but i really need to search "forum_topics_ at the same time, im not sure the correct syntacy in the query to search both at once anyone help me $search_query = "SELECT * FROM `forum_posts` WHERE (`post_body` LIKE '%$keywords%')"; thanks guys Graham Quote Link to comment Share on other sites More sharing options...
chigley Posted June 23, 2007 Share Posted June 23, 2007 Try UNION ALL? Quote Link to comment Share on other sites More sharing options...
lewis987 Posted June 23, 2007 Share Posted June 23, 2007 try this: SELECT * FROM `forum_posts` WHERE `post_body` LIKE CONVERT( _utf8 '%keywords%' USING latin1 ) Quote Link to comment Share on other sites More sharing options...
graham23s Posted June 23, 2007 Author Share Posted June 23, 2007 sorted thanks guys:) Graham Quote Link to comment 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.