lovesmith Posted January 12, 2008 Share Posted January 12, 2008 I have "AvailableIn" field in the table Music. The Field might contain the value either of one or all of them "CD,VCD,CASSETTE" or "CD, VCD" or so on. I have form in my website where user can select to search a album, they got combobox where they can choose whether they want to search in CD, VCD or in DVD. If i use LIKE in query like this. "SELECT album FROM table MUSIC WHERE AvailableIn LIKE "%CD%", it will yield the VCDs AS well. This has been difficult for me as the audio types are in same field with comma separated. Can anybody help me please! Quote Link to comment Share on other sites More sharing options...
twostars Posted January 12, 2008 Share Posted January 12, 2008 I have "AvailableIn" field in the table Music. The Field might contain the value either of one or all of them "CD,VCD,CASSETTE" or "CD, VCD" or so on. I have form in my website where user can select to search a album, they got combobox where they can choose whether they want to search in CD, VCD or in DVD. If i use LIKE in query like this. "SELECT album FROM table MUSIC WHERE AvailableIn LIKE "%CD%", it will yield the VCDs AS well. This has been difficult for me as the audio types are in same field with comma separated. Can anybody help me please! You should just create a separate column for audio types. Otherwise, you'll have to get them with explode("," $AvailableIn); and then check them. Easier to just create a separate column. 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.