For clarity I think you need to show us the database tables too, I'm wondering if you only have a single 'user profile' table in which case you will find it nearly impossible to do what you want. What you should have is a 'user' table, an 'account' table and an 'account line' table. The account table would have a foreign key to the user table so you could tell who owned the account and the account line table would have a foreign key to the account table so you would know which account a posting belonged to.
For presentation, in your select SQL, you would join these three tables to provide the 'statement' data you are looking for.
To be honest I think you need to gain a better understanding of relational database design first before trying to tackle this requirement from the front end. I would suggest picking up a basic book on databases and reading that, it will give you a far better idea of how things really work rather than trying to 'reverse engineer' a pretty screen on another site.