tcloud Posted February 24, 2011 Share Posted February 24, 2011 I want to perform a query which returns a subset of the fields in a table. One particular mySQL field is VARCHAR I have a query like this: $query = mysql_query("SELECT * FROM table WHERE code LIKE '3%') ; It's my understanding this should return all values which begin with "3", but it only returns about a dozen of the values 3, 30-39, 300-399, etc. (It works with string fields, but this field contains numerals.) Any help appreciated. thanks, Tom Link to comment https://forums.phpfreaks.com/topic/228657-how-compare-integer-to-string-in-mysql-query/ Share on other sites More sharing options...
sasa Posted February 24, 2011 Share Posted February 24, 2011 look mysql CAST() function Link to comment https://forums.phpfreaks.com/topic/228657-how-compare-integer-to-string-in-mysql-query/#findComment-1178988 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.