Hey there, Awesome Customers!

Just a heads up: We'll be taking a breather to celebrate International Workers' Day (May 1st and 2nd - Wednesday and Thursday) and Orthodox Easter from Good Friday (May 3rd) through Easter Monday (May 6th). So, from May 1st to May 6th, our team will be off enjoying some well-deserved downtime.

During this time, our customer support will be running on a smaller crew, but don't worry! We'll still be around to help with any urgent matters, though it might take us a bit longer than usual to get back to you.

We'll be back in action at full throttle on May 7th (Tuesday), ready to tackle your questions and requests with gusto!

In the meantime, you can explore our documentation for Amelia and wpDataTables. You'll find loads of helpful resources, including articles and handy video tutorials on YouTube (Amelia's YouTube Channel and wpDataTables' YouTube Channel). These gems might just have the answers you're looking for while we're kicking back.

Thanks a bunch for your understanding and support!

Catch you on the flip side!

Warm regards,

TMS

Okay
  Public Ticket #3169035
Foreign key column search issue
Closed

Comments

  •  1
    Jason King started the conversation

    My data table the column had foreign key, cause the column not able to search any info. It always shows no result.

    Pls let me know possible to fix it?

  •  1,694
    Miloš replied


    Hi, Jason 

    Thanks for reaching out to us

    Please provide me a temporary WP-admin (administrator) user for your site where this happens, so we could log in and take a look ‘from the inside’ as that’s the most efficient way to see and resolve the issue. 

    We do not interfere with any data or anything else except for the plugin (in case that’s a production version of the site), and of course, we do not provide login data to third parties. 

    You can write credentials here just check PRIVATE Reply so nobody can see them except us.

    And point me to this table ID, please. Thanks

    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

  •   Jason King replied privately
  •   Miloš replied privately
  •  1
    Jason King replied

    thanks for your effort to support. 

    ...wait for another team to respond. 

  •   Miloš replied privately
  •   Miloš replied privately
  •  1
    Klemen replied

    I seem to have the same issue and I would like to understand what the resolution was to close this ticket. 

    In my example I have a foreign key to another table and I set up the linkage for that field in wpDataTables. This works for one WP table, but not for the second one. In the second table whenever I select the Type (bcc_shareholders.type_id) other than empty, there are not results, as indicated in screenshots. From what I can tell, the difference between the tables/queries is that in second table the LEFT JOIN can generate rows with type_id IS NULL, whereas the first always contains a valid type_id. 

    Filtering works for this SQL:

    SELECT bcc_shares.id,
           bcc_shares.identification,
           bcc_shares.comment,
           bcc_shares.type_id,
           bcc_shareholders.name
    FROM bcc_shares LEFT JOIN bcc_shareholders ON bcc_shares.id=bcc_shareholders.share_id

    but not for this one:

    SELECT bcc_shareholders.id,

           bcc_shareholders.name,
           bcc_shareholders.address,
           bcc_shareholders.share_id,
           bcc_shares.type_id,
           bcc_shareholders.status_id,
           bcc_shareholders.comment,
           CONCAT('<a href="/shareholder?shareholder_id=', bcc_shareholders.id, '">Details</a>') as details
    FROM bcc_shareholders LEFT JOIN bcc_shares ON bcc_shareholders.share_id=bcc_shares.id



    Attached files:  Screenshot from 2022-12-31 13-32-17.png
      Screenshot from 2022-12-31 13-32-36.png
      Screenshot from 2022-12-31 13-32-52.png

  •  1
    Jason King replied

    Happy new year.

    I guess we need to wait for their new update version. The closing is not really close case.

    I believed they not see this is an issue. The apps should able to handle those features correctly within the setting we can do.

    You may check the old data for both foreign key are correct match. example " Owner", "Owen", "Owner " are not same Foreign key. If your old data having such input mistake recorded in database it may cause error. BTW, if you clean up such issue myphpadmin will be okay, but plugin still not able to search. 


  •  1,694
    Miloš replied

    Hi, Jason and Klemen.

    My apologies for the late response.

    We had a New Years break and are back,   will do our best to be quick with our responses going forward.

    I wish you a Happy New Year, and all the best in 2023.

    -

    Now, to explain what happened.

    We have responded as private message since i did some screenshots from Jason's table, i was not sure if that should be publically shared.

    My senior colleagues from our 2nd level Team made an example as a new table on Jason's site,

    and they also provided an explanation as to what was wrong with the original table configuration, 

    i thought it was clear since there was no response from Jason since then, that was in November, but i can see that i was wrong.

    The ticket got automatically closed, because my last response was in November, 

    our ticketing system closes tickets after 7 days of no replies,  but if anyone replies, the ticket comes up to our attention, we can keep writing on it.

    -

    2. Regarding filtering that was not working for the foreign key for Jason's case:

    The logic for filtering with Foreign key Columns will always be as "Exact Filtering",

    so we always have to input the full value - it will not work for "partial matches".

    But we will double-check these new details that you mentioned, Jason,  i am reaching out to our 2nd level Team again and we will advise you on it.


    -

    @Klemen  ,  if i am not mistaken, you have a ticket opened already for this case, this one? https://tmsplugins.ticksy.com/ticket/3188761

    If that's correct, you said you were not able to reproduce the issue anymore, but i can see that the issue came back?

    Can you please send me WP-Admin access on the ticket, so that we can check the back-end of the table in question?

    If you send us any credentials, please mark the reply as PRIVATE on your ticket, so that only we can see it.

    And please point out to both Table ID's,   

    what is the Table ID that is working without issues;

    and what is the Table ID with the issue as well.

    Then we can check everything for you.

    It will be good if you also grant us access to your database, so that we can check the columns and setup there.

    It can be either link with credentials to PhPMyAdmin or cPanel access.

    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

  •  1,694
    Miloš replied

    Hi guys.

     Since yesterday was 7 days from my response,

     in order to prevent this ticket from closing automatically again, I'm posting another response here to see if you still need assistance with this.

    If this comment goes without a response for another 7 days, please note that the ticket will close again, and we will assume your issues have been resolved.

    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

  •  1
    Klemen replied

    Hi Miloš

    I think both Jason and I are waiting if you have any guidance for us, or ideally you're able to reproduce the issue on your side and suggest how to move forward. I can pretty easily reproduce this on my side. I don't think your demo page allows to create SQL tables in the server, but if it does have mySQL backend I could probably come up with a simplified 2-table case for you to install and then I could setup wpDataTables demo that shows the problem.


    -- Klemen

  •  1,694
    Miloš replied


    Hi, Klemen

    I have responded to your individual ticket, but I will also provide this explanation here.

    Our SQL feature runs everything through our Parser,

    and it has certain limitations.

    -

    Our logic is based on a PHP SQL parser which has full support for the SQL dialect for the following statement types

    SELECT, INSERT, UPDATE, DELETE, REPLACE, RENAME, SHOW, SET, DROP, CREATE INDEX, CREATE TABLE, EXPLAIN and DESCRIBE.

    Some of them are disabled for security reasons.

    Filtering, sorting, and search may not work properly if you include:

    • Accent graves ( ` ) around the table name
    • JOIN functions
    • UNION functions
    • CONCAT functions
    • sub-queries

    In order to prevent these filtering/search issues, you can try preparing a MySQL view (which will return the data that you need, call it e.g. “view1” and then build a wpDataTables based on a simple query like "SELECT * FROM view1″.

    -

    But, in regards to editing,

    When you are using JOINS with more tables please note that in wpdatatables just one table can be editable at the moment and that is the reason why you can't edit fields in table that you made from two tables.

    -

    We are sorry for the inconvenience but those are the limitations that our SQL parser has currently.

    Let us know if that makes sense and if you have any questions. 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