Hi Andrew,
>>> Is it possible to do this with WP data access?
Absolutely!
Let’s say student results are store in table student_results. To link the results to a specific student, add a column – let’s say – student_wp_user_id. Make sure you store the WP User ID of a student in this column and add student_wp_user_id = $$USERID$$ to the default where clause of your publication or project. That’s all! 🙂
The only limitation is thay every student must have a WordPress user account.
Does this help?
Peter
Thread Starter
mlapl1
(@mlapl1)
Thank you so much Peter. That’s exactly what I was looking for. Are there any more $$ variables available from inside WP Data Access?
Cheersw
Andrew
Hi Andrew,
There is a old post which briefly describes available environment variables here:
https://wpdataaccess.com/2021/03/26/environment-variables/
Using these variables in filters is documented here:
https://wpdataaccess.com/docs/documentation/data-projects/adding-filters/
Additional information which might be interesting for your use case can be found here:
https://wpdataaccess.com/docs/documentation/data-projects/user-roles-and-where-clauses/
Let me if you need environment additional variables. I can add them! 🙂
Best regards,
Peter
Thread Starter
mlapl1
(@mlapl1)
Thank you Peter. You are so kind. Actually I am using it in what I hope will be a language learning website. Because of the way the learning tools are constructed and WP and the learning management system I am using are constructed I am not able to pull students’ scores and other information easily out of the WP database and display them. WP Data Access goes a long way toward solving that problem especially with its ability to incorporate sql queries and also javascript (I think- I have not looked in detail). I will happily review the information that you sent me on variables. I know it will be really helpful.
Best to you
Andrew