I’m trying to create a site where members can purchase online courses. To do this, they will need to have a member account that identifies which courses are linked to their account.
With a standard database, I’d simply create two tables one for members and one with course details then create a third link table to hold each of the primary keys. Whilst I can technically do this by creating a database that holds the email & course ID, I can’t see how to create a call to the database that returns a dataset with the course details based on a user.
In short, what I’d like to be able to do is create a member page showing their current courses based on their login with a link & if they try to access a course page that they don’t have permissions for they are redirected back to another page.
In SQL, I’d be creating something like this:
SELECT courseName, coursePage
FROM courses
INNER JOIN courseLink on member.Email = courseLink.memberEmail
WHERE member.Email = ‘@param_email’ //this would need to be accessed dynamically from the page
Thanks!