Okay
  Public Ticket #1406574
Technical questions
Closed

Comments

  • Jeffrey started the conversation

    So, I have several questions regarding the plugin, which BTW is a great tool!  I really appreciate what you all have done with the product.  So here we go:

    1.  The select box does not work on any of the tables on my website.  It works on the backend, but not when deployed on the front-end.  The check box option works, but not the drop-down.  Is this a version compatibility issue with WP?

    2.  Is there any roadmap to allow SET and/or CALL, Prepare and Execute statements within MYSQL?  

    3.  I created a PHP script to handle building a dynamic PIVOT table query within MySQL.  I then call that within wpDataTables using a dynamic select statement with VAR1 defining the table name.  It works great, except the column names don't refresh on the front-end when calling the new table.  I am guessing this is how your tool is built.  It assumes the table structure does not change.  Is there anyway to force a full table refresh on the front-end, so it loads the new columns?  If so, can I also dynamically set table settings through a PHP call or some sort of shortcode?

    Thank you for your help in advance and thank you for this tool.  It has been a wonderful time saver for our company.

    Jeffrey - COO Innersource

  •  472
    Isidora replied

    HI Jeffrey,
    Thank you for your purchase.

    Thank you. We appreciate that.

    1.This can happens when our plugin have conflict with theme or other plugin bootstrap file. Try to change the theme. If is not the theme then some plugin use also some custom bootstrap and try to deactivate him and see is issue is gone.

    2. If your MySQL-query based wpDataTable doesn’t work correctly, probably this is happening because wpDataTables server has problems with parsing of the query and building new queries dynamically (happens rarely, but does sometimes). First try that query in phpmyadmin and if returning data, use that query in wpdatatables. If you don't get result that you expect, 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″.

    3.Sorry but I did not quite understand what are you trying to achieve. Can you please explain me more and send me some example/screenshot so I can give you my suggestion.


    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

  • Jeffrey replied

    Dear Milan,

    Thank you for responding.  The SQL works fine in MySQLWorkbench.  Here is the version I created that does the CREATE VIEW as you suggested.  I also tried a version directly in wpDataTables that was a Select statement:

     

    CREATE TABLE version:

    SET @@group_concat_max_len = 9999999;

                                                                    SET @sql_dynamic = (SELECT GROUP_CONCAT(DISTINCT CONCAT('SUM(CASE WHEN dateCounter = ', "'", dateCounter , "'", ' THEN counterValue END)  AS ', "'" , dateCounter, "'" )) FROM edenener_med1110.enmed_Registration_RoomCountTable LEFT JOIN edenener_med1110.enmed_Registration_MasterTable ON edenener_med1110.enmed_Registration_MasterTable.regID = edenener_med1110.enmed_Registration_RoomCountTable.regID WHERE edenener_med1110.enmed_Registration_MasterTable.formName = "UKYear2,Class5RegistrationForm");

     

                                                                    SET @sql = CONCAT('CREATE VIEW `UKYear2,Class5RegistrationForm` AS SELECT edenener_med1110.enmed_Registration_MasterTable.formName, edenener_med1110.enmed_Registration_MasterTable.attendeeType, edenener_med1110.enmed_Registration_MasterTable.programType, ', @sql_dynamic, ' FROM edenener_med1110.enmed_Registration_RoomCountTable LEFT JOIN edenener_med1110.enmed_Registration_MasterTable ON edenener_med1110.enmed_Registration_MasterTable.regID = edenener_med1110.enmed_Registration_RoomCountTable.regID WHERE edenener_med1110.enmed_Registration_MasterTable.formName = "UKYear2,Class5RegistrationForm" AND edenener_med1110.enmed_Registration_MasterTable.attendeeType != "MIA-Student" GROUP BY formName, attendeetype, programType ORDER BY attendeetype, programType');

                                                                   

                                                                    PREPARE stmt FROM @sql;

                                                                    EXECUTE stmt;

                                                                    DEALLOCATE PREPARE stmt;

     

    SELECT version: 

     

    SET @@group_concat_max_len = 9999999;

    SET @sql_dynamic = (SELECT GROUP_CONCAT(DISTINCT CONCAT('SUM(CASE WHEN dateCounter = ', "'", dateCounter , "'", ' THEN counterValue END)  AS ', "'" , dateCounter, "'" )) FROM edenener_med1110.enmed_Registration_RoomCountTable LEFT JOIN edenener_med1110.enmed_Registration_MasterTable ON edenener_med1110.enmed_Registration_MasterTable.regID = edenener_med1110.enmed_Registration_RoomCountTable.regID WHERE edenener_med1110.enmed_Registration_MasterTable.formName = "UKYear2,Class5RegistrationForm");

     

    SET @sql = CONCAT('SELECT edenener_med1110.enmed_Registration_MasterTable.formName, edenener_med1110.enmed_Registration_MasterTable.attendeeType, edenener_med1110.enmed_Registration_MasterTable.programType, ', @sql_dynamic, ' FROM edenener_med1110.enmed_Registration_RoomCountTable LEFT JOIN edenener_med1110.enmed_Registration_MasterTable ON edenener_med1110.enmed_Registration_MasterTable.regID = edenener_med1110.enmed_Registration_RoomCountTable.regID WHERE edenener_med1110.enmed_Registration_MasterTable.formName = "UKYear2,Class5RegistrationForm" AND edenener_med1110.enmed_Registration_MasterTable.attendeeType != "MIA-Student" GROUP BY formName, attendeetype, programType ORDER BY attendeetype, programType');

     

    PREPARE stmt FROM @sql;

    EXECUTE stmt;

    DEALLOCATE PREPARE stmt;

     

    When I attempted to put this code (with the SELECT version) in wpDataTables I get the error “cannot calculate position” or “set not implemented”, depending on whether or not I include the semicolons.

     

    So, the other issue I had is that when I use a Select from a View Table and if the tables Column headers differ, which it will in my dynamic report.  On the front end of wpDataTables it retains the column headers of the old table and doesn’t pull in the new data.  If I go to the backend and click apply again, it updates the table with the new column headers.

    I will work to pull you a screen shot later today.


    Warm regards,

    Jeffrey


  •  472
    Isidora replied

    Hi Jeffrey,

    We see that you are using complicated queries so you have to make views from them and use it for making wpdatatables. Yes when you change data in the database they will be reflected on frontend on page load, but if you change column headers of that table in database you have to apply that changes in backend because wpdatatables save that column headers in database. So when you change the column headers in database and if you not apply in backend, wpdatatables will use column headers that she saved first time.

    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

  • Jeffrey replied

    Dear Milan,

    Thank you and that is what I was assuming.  Is there anyway to programmatically (I am using PHP to generate the views), to force a backend update with wpDataTables?

    Warm regards,

    Jeffrey


  •  472
    Isidora replied

    Hi Jeffrey,

    You can take a look in our documentation about wpdatatables actions defined in wpDataTables plugin that you can use to customize it for your needs.

    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