Click here to Skip to main content
14,694,397 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
My database table

Id   email            pick-up   track
1     123       abc
2     234       abc
3     324       xyz
4     324       xyz
5     657       xyz
6    435       def
7     879       def
8     324       res
9     324       res

I want to display these data as table format in my web page as below

Id   email            pick-up   track
1     123       abc
2     324(2)    xyz       
3    435       def
4     879       def
5     324(2)    res

What I have tried:

Help me to fix this, I am using having function but not getting result.
Updated 3-Jul-20 6:00am

1 solution

Save the id and email value from the first row that you display. Then as you read each item:
If the id and email match the saved values do not print the first two columns.
If they do not match then copy the new values to the saved items and print the first two columns.
Repeat ad nauseam.
Member 14880123 3-Jul-20 11:22am
Thanks for your reply. did you try this? if yes will you share the code
Richard MacCutchan 3-Jul-20 11:54am
Sorry, but my code is in Univac 1100 series assembler, so it would not make any sense to you. But the code is not exactly difficult; it is just a matter of storing a couple of values and adding an if/else block.
MadMyche 3-Jul-20 11:54am
This is very common and I have done this many times; the code is rather easy

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900