Okay
  Public Ticket #2634280
Limit table data visibility
Closed

Comments

  • Dennis started the conversation

    I have the wp-client plugin for my client portal. I would like to add wpDataTables within that client portal to pull sensor data from a MySQL database. The MySQL database contains similar sensor data for multiple customers. Each customer with sensor data in the database has a unique identifier. Is it possible to have a client log into their client portal on my website using wp-client, load a wpDataTable chart or graph that I set up and ONLY see their client data - even though the MySQL database has similar data for multiple customers?

  • Dennis replied

    Your tutorial, "Creating Editable Tables in WordPress where users can see and edit only their own data" seems very close to what I am looking for. Is there a way to allow users to see only their data but NOT edit it? Make it display only? If I disable "Front Row Editing" in the Editing section, will this still only show the user their specific data (based on their user ID) but not allow them to edit it?

  •  2,572
    Aleksandar replied

    Hello Dennis

    Using that feature you will not be able to do this, but you can use the table's MySQL table name for editing, and create an SQL query based table.

    So, when you go to the Editing tab, copy the MySQL table name for editing. Then create a new table linked to an existing data source/SQL and create a simple table:

    SELECT * FROM wp_wpdatatable_1
    WHERE userID = %CURRENT_USER_ID%

    (example)

    You also need to have one entry in that table in order to do this. So, you're basically filtering the table using the %CURRENT_USER_ID% placeholder.

    Kind Regards, 

    Aleksandar Vuković
    [email protected]

    Rate my support

    wpDataTables: FAQ | Facebook | Twitter | InstagramFront-end and back-end demo | Docs

    Amelia: FAQ | Facebook | Twitter | InstagramAmelia demo sites | Docs | Discord Community

    You can try wpDataTables add-ons before purchasing on these sandbox sites:

    Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables