473,385 Members | 1,373 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Show first letter of a list once?

Hi,

I have a list of names and need to get the first letter from each name and just display it once before the start of that lettered group ie;

what I have:

1
2
3
5
6
Afghanistan
Africa
Albania
Algeria
American Samoa
Bahamas, The
Bahrain
Bangladesh
Barbados
Bouvet Island
Brazil
Bulgaria
Cambodia
Cameroon
Canada
Cape Verde
Caribbean
Chad
Chile
China
Christmas Island
Colombia
Comoros
Congo
Cook Islands
Costa Rica
Cote D'Ivoire
Croatia
Denmark
Djibouti
Dominica


what I would like:

Attached Images
File Type: jpg listname.jpg (27.4 KB, 147 views)
Jul 22 '11 #1
3 2007
Rabbit
12,516 Expert Mod 8TB
I'm assuming the list is coming from a MySQL database. Even though you didn't mention it in the post, you did tag it as such.

As you're looping through the recordset and writing out the data, you just have to compare the prior group to the current group, if it's different, then there's been a change and you can write out the subgroup info.
Jul 22 '11 #2
yes this list generated from mysql database.
Jul 22 '11 #3
Rabbit
12,516 Expert Mod 8TB
I assume as much. My prior advice stands.
Jul 22 '11 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Andrew James | last post by:
Gentlemen, I'm running into a problem whilst testing the parsing of a language I've created with TPG . It seems that for some reason, TPG balks when I try to parse an expression whose first...
3
by: Peter Jenkins | last post by:
Can anyone suggest a better/clearer guide than this A List Apart article? http://www.alistapart.com/stories/accesskeys/ It appears to be not quite right as when I do as it suggests... it...
12
by: Alan J. Flavell | last post by:
OK, today's email brought a comment from a reader, pointing out something that I'd long since noticed myself but hadn't done anything about it. On my pages, I've got a first-letter style on...
1
by: Patrick | last post by:
I am trying to get "first-letter" to work inline withing an anchor. Actually I have not been able to get it to work within an <a> tag whether inline, linked, or embedded. Using IE6 service pack 1....
3
by: news.individual.net | last post by:
Hi! Can I capitalize the first letter of the first paragraph without using a special class for that <p> ? I tried it with this: body > p:first-child:first-letter { font-size: 270%;
6
by: Fungii | last post by:
Hello, I have a stylesheet that sets p:first-letter to a certain size and colour. I was playing around with Javascript to change paragraph stylesheets using an array like this: var paras =...
1
blyxx86
by: blyxx86 | last post by:
I have the code to capitalize an entire string when it is input, but would like to capitalize just the first letter of a box, or match the case of a drop down list.. My current code is thus: ...
2
by: setabery | last post by:
When entering a value to a field, is there a way to make only the first letter upper case without using the Shift Key? For example, entering a name.
2
by: sehodge | last post by:
<STYLE type="text/css"> P { font-size: 10pt; color:#000;} P:first-letter { font-size: 150%; color:red; font-weight: bold; float: left } </STYLE> Later, I want the first...
2
by: backups2007 | last post by:
I have a customer information form that has a list box containing all the names of the customers. And when submitted and inserted to the database, automatically displays the information onto the list...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.