nepoverljiv Posted October 30, 2011 Share Posted October 30, 2011 How to search 4 columns for one words. I can't with OR because isn't good for my search. I need to look in columns : genres1, genres2, genre3, genres4; are they have on particularly word. Can anyone help me with this? Are can maybe with MATCH? Quote Link to comment Share on other sites More sharing options...
AyKay47 Posted October 30, 2011 Share Posted October 30, 2011 mysql_query("SELECT column FROM table WHERE MATCH('column1','column2','column3','column4') AGAINST ('keyword')"); http://dev.mysql.com/doc/refman/5.5/en/fulltext-search.html Quote Link to comment Share on other sites More sharing options...
nepoverljiv Posted October 30, 2011 Author Share Posted October 30, 2011 Not work. I try $proba = mysql_query("SELECT column FROM filmovi WHERE MATCH('genres1','genres2','genres3','genres4') AGAINST ('Action')"); What can be problem, and what SELECT column FROM means? Quote Link to comment Share on other sites More sharing options...
AyKay47 Posted October 30, 2011 Share Posted October 30, 2011 insert the correct column names that you want to grab where i put "column" Quote Link to comment Share on other sites More sharing options...
nepoverljiv Posted October 30, 2011 Author Share Posted October 30, 2011 But I don't have just one column, I have 4. How to write right name when I have 4 name. How to which name is right? Quote Link to comment Share on other sites More sharing options...
fenway Posted October 31, 2011 Share Posted October 31, 2011 Again, read the link provided -- make a fulltext index that spans all 4 columns. 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.