Okay
  Public Ticket #3106147
Using %CURRENT_USER_LOGIN% in SQL query
Closed

Comments

  • Augusto started the conversation

    Hi, sorry if this question has been asked before I couldn't find a related ticket.

    I'm trying to use %CURRENT_USER_LOGIN% in the sql query so that the table will only show said user's data in the table. The values of the column "PRODUCTOR" are the same as the user login.


    4773400310.png
    is not something more complex than that, but it gives me this warning


    3975697813.png



    Previously I was trying to use the placeholder option, where I defined the "Predefined Values" cell as %CURRENT_USER_LOGIN% and it works so long as nobody uses the "clean the filters" option, then this value dissapears and all the table values are shown.

    It is important that users dont see other users data.

    If you can help me with the correct syntax, I would appreciate it



    Best Regards
    Augusto

  •  1,667
    Miloš replied

    Hi, Augusto

    Sorry for the delay

    It might be tricky to determine exactly the issue with this SQL Query,

    i will ask for help from our 2nd level Team if needed;

    but it will be much easier, if we go back to using the filter, as before - but i can help you hide the "Clear Filter" , or i can help you hide the filter, for a specific column, with CSS, if you wish ? 

    Then users won't be able to use it.smile.png

    Let me know if that can be a solution ?  

    Could you also show me a screenshot or a video of how the tables looks - and elaborate a bit more on what kind of a filter setup you need;

    do you need some filters to be available, along with "clear filters", if that is crucial? Thank you


    Kind Regards, 

    Miloš Jovanović
    [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