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 Quote 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 Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.