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 Link to comment https://forums.phpfreaks.com/topic/56873-solved-syntax-help/ Share on other sites More sharing options...
chigley Posted June 23, 2007 Share Posted June 23, 2007 Try UNION ALL? Link to comment https://forums.phpfreaks.com/topic/56873-solved-syntax-help/#findComment-280990 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 ) Link to comment https://forums.phpfreaks.com/topic/56873-solved-syntax-help/#findComment-280998 Share on other sites More sharing options...
graham23s Posted June 23, 2007 Author Share Posted June 23, 2007 sorted thanks guys:) Graham Link to comment https://forums.phpfreaks.com/topic/56873-solved-syntax-help/#findComment-281067 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.