I'm setting up a page to order last names. I want to have links at the top of the page like (A-C D-F G-I) and so on. So I need to be about to do a search on just the first letter of the last name.
Any suggestion?
Thanks
Depends on the database as to what the syntax is, but for MySQL this should work.
SELECT * FROM table WHERE UPPER(name) LIKE 'A%' OR UPPER(name) LIKE 'B%' OR UPPER(name) LIKE 'C%';
That's actually what I did and it returns all words that have an A or B or C anywhere in the spelling!?
That's kinda why i'm stumped.
If you use '%a%' then it will find each occurence of 'a', but if you leave out the first %, it will only find the first.
I was just going to say that.
Thank you all for the help. I have it up and running.
Thanks again.