nignix Posted March 1, 2011 Share Posted March 1, 2011 Hello, how can i make query to show all records that begin with number 555? I mean if i have in my table codes like: 55554567845 44744686486 55556875124 55558612214 33335854111 and i want to show only codes that starts *5555* Thanks for help. Link to comment https://forums.phpfreaks.com/topic/229276-php-query-to-show-records-that-starts-with-number-555/ Share on other sites More sharing options...
samoht Posted March 1, 2011 Share Posted March 1, 2011 well are the records coming from the same field in a single table ?? if so then SELECT `yourfieldname` FROM yourtablename WHERE `yourfieldname` LIKE '555%' Link to comment https://forums.phpfreaks.com/topic/229276-php-query-to-show-records-that-starts-with-number-555/#findComment-1181379 Share on other sites More sharing options...
nignix Posted March 1, 2011 Author Share Posted March 1, 2011 thanks, helpful Link to comment https://forums.phpfreaks.com/topic/229276-php-query-to-show-records-that-starts-with-number-555/#findComment-1181391 Share on other sites More sharing options...
Maq Posted March 1, 2011 Share Posted March 1, 2011 Please be conscious of where you post (moved to the MySQL section). As samoht mentioned, use: http://dev.mysql.com/doc/refman/5.0/en/string-comparison-functions.html#operator_like Link to comment https://forums.phpfreaks.com/topic/229276-php-query-to-show-records-that-starts-with-number-555/#findComment-1181392 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.