jandrews Posted March 22, 2009 Share Posted March 22, 2009 Hi, Its easy enough to display a query with all results beginning with a letter: $query_artists = sprintf("SELECT playlist_music FROM flamplayer_musics WHERE playlist_music LIKE '%s%%' GROUP BY playlist_music ORDER BY playlist_music ASC", ...but what if some of your database entries begin with a number? how do you ask for all results beginning with a number? Link to comment https://forums.phpfreaks.com/topic/150630-what-defines-a-number-in-php/ Share on other sites More sharing options...
trq Posted March 22, 2009 Share Posted March 22, 2009 Sql queries are sql, not php, moving. Link to comment https://forums.phpfreaks.com/topic/150630-what-defines-a-number-in-php/#findComment-791261 Share on other sites More sharing options...
Yesideez Posted March 22, 2009 Share Posted March 22, 2009 You do the same but use a number instead of a letter. Link to comment https://forums.phpfreaks.com/topic/150630-what-defines-a-number-in-php/#findComment-791309 Share on other sites More sharing options...
Maq Posted March 22, 2009 Share Posted March 22, 2009 Found this solution on another forum: Select * from table_name where column REGEXP '^[0-9]'; Link to comment https://forums.phpfreaks.com/topic/150630-what-defines-a-number-in-php/#findComment-791318 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.