• Resolved sarasotasam

    (@sarasotasam)


    I need to filter a table by a customer id and then display that table on the customer’s page. Does WP Data Access do this?

    Thanks in advance – Sam

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Contributor Kim L

    (@kimmyx)

    Hi @sarasotasam,

    Yes! You can display a filtered table (frontend) using WP Data Access.

    Please check this page for more information: Static filters | WP Data Access

    Hope this helps! Let us know if you have more questions.

    Thread Starter sarasotasam

    (@sarasotasam)

    FYI – tried to leave a comment on your static filters page, but the captcha is not working.

    Trying to understand Static Filters:
    My web page is where my clients place and view there orders.
    When they sign in I want a table to display their orders.
    When they sign in their ID is hidden.
    I would like WP Data Access to record their ID and display only their records.
    Tried Where Clause, but have not gotten it to work.
    Where Clause: dr_id= (this is where I am stuck) what do I put after the = so that the table reads the Hidden ID and just shows their records.

    Thanks in advance – Sam

    Plugin Contributor Kim L

    (@kimmyx)

    Hi @sarasotasam,

    Thanks for the additional information.

    The equal sign just follows the value of the column you use. For example:

    id = 1

    This is how it looks in the field: https://share.getcloudapp.com/6qub7pQD

    If you want to hide their ID column, you can choose which column to display in the table in the Column Names field under the Publication Data section.

    Please see this demo: https://share.getcloudapp.com/Qwu8Dz9N

    Re: The comment captcha
    We tried submitting a comment just now and we were able to submit a comment. It must have been a temporary glitch. If you’re still unable to submit a comment, please try using a different browser or via incognito. ??

    Hope this helps! Let us know if you have more questions.

    Thread Starter sarasotasam

    (@sarasotasam)

    So far the solutions you have given me have not worked.

    My client logs in and is taken to a page where the table is and the dr_id is:

    global $current_user;
    if ( is_user_logged_in() ) {
    echo ”, $current_user->dr_id;
    } else {
    echo ”;
    }

    I want the table to filter so only the current_user records are shown.

    FYI – Your response to my question has been excellent. I have tried WpData Tables. Asked them a question and they still have not gotten back to me.

    Plugin Contributor Kim L

    (@kimmyx)

    Hi @sarasotasam,

    Sorry for the confusion, I thought dr_id is a column in the table!

    Please check out this documentation page: User roles | WP Data Access

    This might be more suited to what you wish to achieve.

    Let us know if this helps! ??

    Hi @sarasotasam,

    could you find a solution to your question?

    I’ve got a similar issue.

    Thanks in advance for any update.

    Thread Starter sarasotasam

    (@sarasotasam)

    Not yet. Have to say that support has not been terribly helpful. They could probably given me the solution, but they haven’t.

    Plugin Contributor Kim L

    (@kimmyx)

    Hi @sarasotasam,

    Peter recently responded to your email about the user roles, but you haven’t gotten back. Were you able to see it?

    Just in case you haven’t, Peter referred to this link in case this is what you needed:
    WordPress user ID in SQL | WP Data Access
    Environment variables | WP Data Access (old way, but still works)

    Let us know if this helps! Hope this helps you too, @measy ! ??

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Filter by ID in Mysql Database’ is closed to new replies.