phporcaffeine Posted January 24, 2007 Share Posted January 24, 2007 Example:column 'test' = '|48962||34545|'I need to be able to SELECT based on column 'test' but I may only have |48962| and not |34545|.I tried:SELECT col1, col2, col3 FROM tbl WHERE test LIKE |48962|but it didn't work, any ideas?-Thanks Link to comment https://forums.phpfreaks.com/topic/35529-use-php-to-select-column-in-db/ Share on other sites More sharing options...
Jessica Posted January 24, 2007 Share Posted January 24, 2007 You need to surround strings with ''"SELECT col1, col2, col3 FROM tbl WHERE test LIKE '|48962|'""didn't work" is very vague. Be more specific. Link to comment https://forums.phpfreaks.com/topic/35529-use-php-to-select-column-in-db/#findComment-168192 Share on other sites More sharing options...
phporcaffeine Posted January 24, 2007 Author Share Posted January 24, 2007 Okay I did surround in quotes ...SELECT col1, col2, col3 FROM tbl WHERE test LIKE '|48962|'I mean it returns an empty result set Link to comment https://forums.phpfreaks.com/topic/35529-use-php-to-select-column-in-db/#findComment-168195 Share on other sites More sharing options...
Jessica Posted January 24, 2007 Share Posted January 24, 2007 SELECT col1, col2, col3 FROM tbl WHERE test LIKE '%|48962|%' Link to comment https://forums.phpfreaks.com/topic/35529-use-php-to-select-column-in-db/#findComment-168207 Share on other sites More sharing options...
phporcaffeine Posted January 24, 2007 Author Share Posted January 24, 2007 thank you Link to comment https://forums.phpfreaks.com/topic/35529-use-php-to-select-column-in-db/#findComment-168231 Share on other sites More sharing options...
Jessica Posted January 24, 2007 Share Posted January 24, 2007 No problem. Link to comment https://forums.phpfreaks.com/topic/35529-use-php-to-select-column-in-db/#findComment-168232 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.