Okay
  Public Ticket #1680927
Searching With Concatenated Queries
Closed

Comments

  • Daniel started the conversation

    Hi, I am trying to figure out how to be able to search a table when within the query is a CONCAT string for 1 of the columns.

    Here is the query

    -----------------------------------------------

    SELECT 
        contract_id,
        CONCAT("<a href='/contracts.php?id=",contract_id,"' TARGET='_BLANK'>View</a>") AS Contract,

    FROM partner_contracts

    -------------------------------------------

    When searching the JSON contains:

    ################################

    lass="wpdberror">WordPress database error:  [    Unknown column 'partner_contracts.Contract' in 'where clause'
    

    ################################

    Is it possible to achieve this using wpDataTables?

    Many thanks in advance

    Kind Regards

  •  472
    Isidora replied

    HI Daniel,
    Thank you for your purchase.

    Sorry for late response. 

    We are located in Serbia and our working time is from 10:00 to 17:00 CET. business days.

    If your MySQL-query based wpDataTable doesn’t work correctly with server-side processing, probably this is happening because wpDataTables server has problems with parsing of the query and building new queries dynamically (happens rarely, but does sometimes). To avoid this please prepare a MySQL view (a stored query), which will return the data that you need, call it e.g. “view1” and then build a wpDataTabled based on a simple query like “SELECT * FROM view1″.



    Kind Regards, 

    Isidora Markovic

    wpDataTables: FAQFacebookTwitterFront-end and back-end demoDocs

    Amelia: FAQFacebookTwitter |  Amelia demo sites | Docs

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

    Powerful FiltersGravity Forms Integration for wpDataTablesFormidable Forms Integration for wpDataTables