• Hello. I just installed your plugin and love it so far. Should get the premium soon. I have a few questions to see what else it can be used for. Here is one: Can it be used to pull data fields from the database by using variables? Be it in a post or page content? Something like: “The state of %%state_name%% consists of %%city_count%% cities.”

    Thanks

    Tim

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter timsilva2

    (@timsilva2)

    Hi Peter. To be even more specific, what I’m trying to do is to have a way to populate a tooltip dynamically. So, in the example above, if a user clicks (or hover) over the word “Texas” in a page content, it will pull the Texas info from the DB. If a Bible verse reference, it will pull the actual verse from the DB. There are plugins that do that already, but for some reason they slow the page load too much if you have a large database (I’ve tried many). Your programing skills seems to have solved this major obstacle. I would appreciate any pointer. Thanks

    Plugin Author Passionate Programmer Peter

    (@peterschulznl)

    Hi Tim,

    Looks like you need some kind of shortcode solution to add content to your web page which accesses the database on mouse over I guess? WP Data Access does not have such a shortcode, but you could use the Code Manager to write a PHP shortcode implementation and use the WP Data Access library to access your database. This would allow you to even access a remote database from your own PHP code like this:
    $wpdadb = \WPDataAccess\Connection\WPDADB::get_db_connection( $schema_name );
    Where $schema_name is either the schema name of your local database or a remote database (needs to be added in the Data Exxplorer). You can use $wpdadb to access the database and add content to your webpage. If you want to use shortcode parameters you can write your own shortcode which requires the premium version of the Code Manager.

    Does this help?
    Peter

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Using variables to pull data’ is closed to new replies.