Use shortcode wpdataaccess to show database tables and views on your website. jQuery DataTables is used to provide dynamic read-only HTML tables supporting pagination, sorting and searching. Choose between flat and responsive tables.
Shortcode wpdataaccess must be enabled:
Settings > WP Data Access > Plugin > Shortcode [ wpdataaccess ]
Data Publisher shortcodes
You can use the Data Publisher to create publications. Every publication has a unique publication id (pub_id) and a unique publication name (pub_name) and can be used in shortcode wpdataaccess. Supported shortcode parameters:
- pub_id (publication id)
- pub_name (publication name)
- filter_field_name (field name(s) to be filtered)
- filter_field_value (field value(s) to filter, performs a LIKE and therefor allows wildcards)
Copy/paste shortcode from a publication
There’s no need to type in the shortcode. The shortcode can be copied from the Data Publisher to your clipboard and pasted into your page or post:
- Start the Data Publisher
- Click on link Shortcode
- Copy shortcode to clipboard
- Edit your page or post
- Paste shortcode into your page or post
When you transfer a publication to another server, the publication id might change. For this reason parameter pub_name was introduced, which you can use to test and publish a publication on different hosts. Example:
[wpdataaccess pub_name="My Publication"]
Live example without styling
For security reasons shortcode parameter sql_where is no longer available. Please use parameters filter_field_name and filter_field_value to add a safe filter . The plugin still allows to add a safe where clause on the Data Publisher data entry page.
[wpdataaccess pub_id="18" filter_field_name="lastname" filter_field_value="jose%"]
[wpdataaccess pub_id="6" filter_field_name="job,ename" filter_field_value="president,ford"]
For filters containing multiple column names and values, use a comma seperated value and make sure the array size of filter_field_name and filter_field_value are the same. The filter allows to use % as a wildcard.