Finding Unique Fields from Database

Put your problem here if it does not fit any of the other categories.

Finding Unique Fields from Database

Postby ramgraph1 » Wed Mar 19, 2008 11:11 pm

I am using this code to get usernames from a database:

Code: Select all
Cursor c = dbhelper.fetchInfo(usersearch);
user1 = c.getString(c.getColumnIndex(dbhelper.KEY_username));


"usersearch" increases by one each time to move to the next row and I do the same for user2. However, one user can have their name in the "username" field of more than one row. I don't want to set user2 (etc.) to a name that I have already set user1 to.
How can I filter the info from the database to just give me only UNIQUE user names?
Any ideas?
Thanks.
ramgraph1
Experienced Developer
Experienced Developer
 
Posts: 68
Joined: Wed Jan 09, 2008 10:03 pm

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: MSNbot Media and 16 guests