Display transaction ID from MySQL db after logged in user paid


Please consider this:

  • A user logs into his account where login data is stored in a table named ‘users’.
  • He chooses to pay a membership where the transaction data is stored in a table named ‘memberships’.
  • In his account his personal payment information is displayed that is taken from the ‘memberships’ table.

How can this be done? I know how to display one’s account’s personal data from ‘users’ table after logged in, but I don’t know how to display transaction data relative to one’s account.


You’d put a column user_id in the membership table and the select using something like

SELECT some, useful, fields FROM membership WHERE user_id = :user_id

Assuming you know the ID of the logged in user, that should be in the session.

1 Like

Thank you rpkamp, this does the job

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.