PHP to Javascript to PHP – WordPress

I am displaying a list of names on a page in wordpress. And from that list of names, a user can click the name on the ‘list of names’ on the page. Then it will redirect to a modal. So I have now a specific name being clicked. And from that, I will display another details (like projects involve by this specific person) from another table on this specific user.

Since I have now a specific user, on my query on the modal , the condition there is the javascript variable that i passed on the modal . my question is:

How to convert a javascript variable to be compared in a query?

here is my actual query:

SELECT * FROM xyz77_projects WHERE wp_teams_team_id IN (SELECT team_id FROM xyz77_teams WHERE wp_employee_emp_id = _______ )

the blank there is the specific id of the name that is being clicked.

Read more here: PHP to Javascript to PHP – WordPress

Leave a Reply

Your email address will not be published. Required fields are marked *