Selecting From MySQL Database Question...

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
Mr. Tech
Forum Contributor
Posts: 205
Joined: Tue Feb 11, 2003 4:18 pm
Location: Australia

Selecting From MySQL Database Question...

Post by Mr. Tech »

I have a table which records items with a number. E.g:

key1 key2 key3 key4 key5 key6 key7 key8
5 1 0 0 0 0 3 0

Now what I want to do is show those results on a page BUT for each row(key#), I want to show it the amount of times the number that is recorded in it. For key1, it would show results of it 5 times. for key2 it would show it 1 time. E.g:

Key1
Key1
Key1
Key1
Key1
Key2
Key6
Key6
Key6

How can I do this? I could do this without doing it this way except I'm going to have up to 75 results to select...

Let me know if you don't explain because I'll try to explain better.

Thanks

Ben
User avatar
infolock
DevNet Resident
Posts: 1708
Joined: Wed Sep 25, 2002 7:47 pm

Post by infolock »

this page is just what you need :

http://www.onlamp.com/pub/a/onlamp/exce ... ?page=last


moving this thread to database section
Post Reply