ryansdistrict Posted November 7, 2008 Share Posted November 7, 2008 hey folks how can i write a query from a mysql database that will fetch from the database all the names of members who got the first letter of their names a certain letter forexample letter a and how to have the non letters in 1 query i though of doing something like SELECT col FROM table WHERE col LIKE 'v%' Link to comment https://forums.phpfreaks.com/topic/131798-all-started-with-letter-a/ Share on other sites More sharing options...
fenway Posted November 7, 2008 Share Posted November 7, 2008 You mean like: WHERE first_name LIKE 'a%' ? Link to comment https://forums.phpfreaks.com/topic/131798-all-started-with-letter-a/#findComment-684655 Share on other sites More sharing options...
ryansdistrict Posted November 7, 2008 Author Share Posted November 7, 2008 [i am making babys name script where it shows babies names details origin meaning and such details] yes what about the numbers and other characters also how can i make the index page where the links located for each letter any idea ? another question in the database their is countries for the origin of each name How can i generate a query for each country name in an easy way in the and index it in the index page Link to comment https://forums.phpfreaks.com/topic/131798-all-started-with-letter-a/#findComment-684660 Share on other sites More sharing options...
rhodesa Posted November 7, 2008 Share Posted November 7, 2008 Try for letters: WHERE UPPER(first_name) REGEXP '^A' and for non-letters: WHERE UPPER(first_name) REGEXP '^[^A-Z]' Link to comment https://forums.phpfreaks.com/topic/131798-all-started-with-letter-a/#findComment-684664 Share on other sites More sharing options...
fenway Posted November 7, 2008 Share Posted November 7, 2008 Assuming you're working with case-insensitive collations (the default), UPPER() shouldn't matter. Link to comment https://forums.phpfreaks.com/topic/131798-all-started-with-letter-a/#findComment-684693 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.