killah Posted April 20, 2009 Share Posted April 20, 2009 I have a table and a varchar field. In this field it has data like this: 1 => 1,2,3,4,5,6,7,8,9 2 => 10,11,12,13,14,15,16,17 3 => 10,14,17,29 4 => 32,45,86,10,1 When i try fetching like this: SELECT upNAME FROM `upgrades` WHERE 10 IN(`upPLACES`) It shows 2 & 3 and does not show number 4 where it should. Is there a way i don't need to have the numbers be like this: '32','45','86','10','1' and not be in an array or some sort? I have mysql_error() turned on, and it produced no error. Thanks in advanced. Link to comment https://forums.phpfreaks.com/topic/154817-solved-mysql-in-help/ Share on other sites More sharing options...
fenway Posted April 20, 2009 Share Posted April 20, 2009 How? Link to comment https://forums.phpfreaks.com/topic/154817-solved-mysql-in-help/#findComment-814476 Share on other sites More sharing options...
killah Posted April 20, 2009 Author Share Posted April 20, 2009 SELECT `upNAME` FROM `upgrades` WHERE CONCAT(',',`upPLACES`,',') LIKE '%,10,%'; Link to comment https://forums.phpfreaks.com/topic/154817-solved-mysql-in-help/#findComment-814587 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.