Guest Posted September 24, 2007 Share Posted September 24, 2007 I am trying to make a query that will only bring up rows that have a certian amount of characters.Is it possible to do this for two characters? Link to comment https://forums.phpfreaks.com/topic/70432-mysql-select-amount-characters/ Share on other sites More sharing options...
jitesh Posted September 24, 2007 Share Posted September 24, 2007 Not sure but just try. select * from `table` where (CHAR_LENGTH(`fieldname`) = 2) May be just working with Mysql 5 Link to comment https://forums.phpfreaks.com/topic/70432-mysql-select-amount-characters/#findComment-353836 Share on other sites More sharing options...
fenway Posted September 24, 2007 Share Posted September 24, 2007 or LENGTH()? Beware of multi-byte characters. Link to comment https://forums.phpfreaks.com/topic/70432-mysql-select-amount-characters/#findComment-354128 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.