

Get in touch

Download Plugin Now
  • Follow
  • Follow
WP Data Access
  • Download
  • Support
  • Features
  • Pricing
  • Documentation
    • Tool Guide
    • App Builder
    • Data Explorer
    • SQL Query Builder
    • Plugin Settings
    • Legacy Tools
    • Remote Connections
a
M
M
  • Download
  • Support
  • Features
  • Pricing
  • Documentation
    • Tool Guide
    • App Builder
    • Data Explorer
    • SQL Query Builder
    • Plugin Settings
    • Legacy Tools
    • Remote Connections
Download Plugin Now

SQL Query Builder

  • Getting Started
  • Tutorials
  • Visual Query Builder
  • Writing queries
  • Data exchange
  • Stored procedures
  • Database triggers
  • Scheduled queries
  • WordPress user ID in SQL
View Categories

Writing queries

You must be an admin user to use the Query Builder

Write and execute SQL queries #

The Query Builder starts with an empty tab. SQL commands are written in the editor below the tab. Select a database, enter a query in the editor and press the Execute button.
SQL Query Builder – Click to Enlarge

Multiple SQL commands #

The Query Builder does not only support queries. It basically supports any SQL command (DCL, DDL and DML) as long as you have the necessary privileges. If you are ISP hosted, your privileges will be limited.

Write / on an empty line to separate SQL commands. Example:

drop table if exists x
/

create table x
(x int)
/

insert into x values(1)
/

insert into x values(2)
/

update x
set x = x + 100
/

select *
from x
/

Will result in 6 tabs. Each tab is related to a query/command and shows the query results for that specific SQL statement.

User defined variables and dynamic queries #

The Query Builder supports used defined variables and dynamic queries. Here is an example:
SET @column = "columnname"
/

SET @table = "tablename"
/

SET @select = CONCAT("SELECT ", @column, " FROM ", @table)
/

PREPARE stmt FROM @select
/

EXECUTE stmt
/
  • Read more about user defined variables…

Protect WordPress tables #

WordPress tables are protected by default. It is possible to disable this protection with restrictions. For obvious reasons it is not possible to DROP, ALTER or TRUNCATE WordPress tables in general. With WordPress table protection disabled, the plugin allows users to perform INSERT, UPDATE and DELETE operations on WordPress tables. Making changes to WordPress tables is not recommended!

Database response #

The database response is shown in a scrollable table below the editor. The table data can be exported to CSV, JSON and XML.

View raw output #

Use the icon below the scrollable table to view the raw database output. The output is shown in JSON format and is read-only.

Save query #

Double click on the tab to give the query a name. Click Save to save the query.

Open query #

Click the arraw down icon in the page title, select the query from the list and click Open selected. The listbox contains only query that are currently not edited.

Open all queries #

Click the arraw down icon in the page title and click Open all. The listbox contains only query that are currently not edited.

Execution time #

Add the following lines to your wp-config.php to show the execution time between round brackets (see screenshot above – click to enlarge):

define( 'WP_DEBUG_LOG', true );
define( 'SAVEQUERIES', true );
Share This Article :
  • Facebook
  • X
  • LinkedIn
  • Pinterest
Still stuck? How can we help?

How can we help?

Updated on 2025-02-07
Visual Query BuilderData exchange

Submit a Comment Cancel reply

Your email address will not be published. Required fields are marked *

Table of Contents
  • Write and execute SQL queries
  • Multiple SQL commands
  • User defined variables and dynamic queries
  • Protect WordPress tables
  • Database response
  • View raw output
  • Save query
  • Open query
  • Open all queries
  • Execution time
WP Data Access
  • Follow
  • Follow
Quick Links
$

Blogs

$

Tutorials

$

Demos

Get in touch
$

Premium support

$

Free support forum

$

Contact us

Resources


WordPress plugin directory



YouTube tutorials

Copyright © 2025 | All Right Reserves

We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.Ok