Lister471 Posted February 2, 2013 Share Posted February 2, 2013 Good evening. Sorry for the poor title but i have no idea really what i should call it. I have a script that simply extracts the results from a table that match the day of the week. So today would be 6 so if any items match 6 then they will be echoed out. However there is a option when adding items to select witch days you wish to item to be included so if you select more than 1 then the value in the table is not 6 it could be 16 or 36 so when i use the WHERE to look for items that match the day it see's 36 or 16 and does not return anything. My question is, is there a way to WHERE for items that include a 6? so even if the result returned is 36 or 1236 it would recognize there is a 6 in the string. I hope the above make sense. I know what i mean in my head, just having a hard time explaining it. Thanks in advance. Paul Aka Lister471 Quote Link to comment https://forums.phpfreaks.com/topic/273959-comparing-to-table-problem/ Share on other sites More sharing options...
jac.kock Posted February 2, 2013 Share Posted February 2, 2013 hi, try to query with like exp.: $qwery='6'; $sql="select * from [youre table] where [table field exp.: dayofweek] like '%$qwery%'"; $result=mysql_query($sql); ect ect .... Quote Link to comment https://forums.phpfreaks.com/topic/273959-comparing-to-table-problem/#findComment-1409759 Share on other sites More sharing options...
Lister471 Posted February 2, 2013 Author Share Posted February 2, 2013 Many thanks seems to work great. Thanks again. Quote Link to comment https://forums.phpfreaks.com/topic/273959-comparing-to-table-problem/#findComment-1409764 Share on other sites More sharing options...
jac.kock Posted February 2, 2013 Share Posted February 2, 2013 yw Quote Link to comment https://forums.phpfreaks.com/topic/273959-comparing-to-table-problem/#findComment-1409766 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.