Search Results :

×

Write WordPress Custom SQL Query | Query WordPress database


Do you ever feel like you need more control over the WordPress database? If so, you're not alone. Many developers struggle with writing code for complex SQL queries to access and modify the WordPress database via APIs. Fortunately, there's a simpler solution: miniOrange Custom API for WordPress. With this powerful tool, you can quickly and easily query the WordPress database, fetch data from custom tables, and pass custom query parameters, all through a Graphical User Interface (GUI).

The WordPress database can be interacted using a custom SQL query. This can often be cumbersome and time-consuming. The solution to that is to use a custom API that can call tables and data customized to your needs without the need to write code. miniOrange Custom API for WordPress provides you with a Graphical User Interface (GUI) where you can write a custom SQL query to interact with the WordPress database. It enables you to call default tables or custom ones tailored to your requirements and get the data you need.

Download And Installation

  • You will require the Enterprise version of the Custom API for the WordPress plugin.
  • You will need an account with miniOrange.
  • You will also need to be logged in to WordPress as an administrator.

Custom API for WordPress
By miniOrange

Custom API for WordPress plugin allows you to create WordPress APIs / custom endpoints / REST APIs. You can Fetch / Modify / Create / Delete data with an easy-to-use graphical interface.

Know More

miniorange img Set up the Custom API for WordPress that allows you to call the WordPress database according to your needs:



      Follow the steps mentioned below to configure Custom API for WordPress to write a Custom GET SQL query in WordPress:


    • Go to the Create Custom SQL API tab and click on Create SQL API button.
    • WordPress custom SQL query-GET method
    • Fill the API Name as desired and select the GET Method and write the required SQL query to get the data in the SQL Queries field
    • WordPress custom SQL query-Get method
    • Note: to send custom parameters, you can write the query like the following:
      SELECT * FROM wp_options WHERE option_id={{custom_parameter}}; having _ is mandatory in the parameter name
    • Click the Save button and you will see the following screen which contains your custom API.
    • WordPress custom SQL query-Get method
    • You can test the API by clicking on the Test button and fill the value for the parameter.
    • WordPress custom SQL query-GET method
    • Click on Continue to see the test results.
    • WordPress custom SQL query-GET method

      Congratulations, you have successfully configured the Custom API for WordPress to write a custom SQL Query to GET the data from the WordPress database!



      Follow the steps mentioned below to configure Custom API for WordPress to write a Custom POST SQL query in WordPress:


    • Go to the Create Custom SQL API tab and click on Create SQL API button.
    • WordPress custom SQL query-post method
    • Fill the API Name as desired and select the POST Method and write the required SQL query to get the data in the SQL Queries field
    • WordPress custom SQL query-post method
    • Note: to send custom parameters, you can write them like the following:
      INSERT INTO custom_table (ID, name, email, status) VALUES ('{{custom_param1}}','{{custom_param2}}','{{custom_param3}}','{{custom_param4}}'); having _ is mandatory in the parameter name
    • Click the Save button and you will see the following screen which contains your custom API URL. You need to pass the data in body as x-www-form-url-encoded or JSON format.
    • WordPress custom SQL query-post method
    • You can test the API by clicking on the Test button and fill the value for the parameters
    • WordPress custom SQL query-post method
    • Click on Continue to see the test results. 1 inTest Result means data has been successfully added to the database.
    • WordPress custom SQL query-post method

      Congratulations, you have successfully configured the Custom API for WordPress to write a custom SQL Query to POST the data from the WordPress database!



      Follow the steps mentioned below to configure Custom API for WordPress to write a Custom PUT SQL query in WordPress:


    • Go to the Create Custom SQL API tab and click on Create SQL API button.
    • WordPress custom SQL query-put method
    • Fill the API Name as desired and select the PUT Method and write the required SQL query to get the data in the SQL Queries field
    • WordPress custom SQL query-put method
    • Note: to send custom parameters, you can write the query like the following:
      UPDATE custom_table SET ID='{{custom_param1}}',name='{{custom_param2}}',email='{{custom_param3}}',status='{{custom_param4}}' WHERE ID={{custom_param5}}; having _ is mandatory in the parameter name
    • Click the Save button and you will see the following screen which contains your custom API URL. You need to pass the data in body as x-www-form-url-encoded or JSON format.
    • WordPress custom SQL query-put method
    • You can test the API by clicking on the Test button and fill the value for the parameters. You need to pass the data in body as x-www-form-url-encoded or JSON format.
    • WordPress custom SQL query-put method
    • Click on Continue to see the test results. 1 inTest Result means data has been successfully added to the database.
    • WordPress custom SQL query-put method

      Congratulations, you have successfully configured the Custom API for WordPress to write a custom SQL Query to UPDATE the data in the WordPress database!



      Follow the steps mentioned below to configure Custom API for WordPress to write a Custom DELETE SQL query in WordPress:


    • Go to the Create Custom SQL API tab and click on Create SQL API button.
    • WordPress custom SQL query-Delete method
    • Fill the API Name as desired and select the DELETE Method and write the required SQL query to get the data in the SQL Queries field
    • WordPress custom SQL query-Delete method
    • Note: to send custom parameters, you can write them like the following:
      DELETE FROM custom_table WHERE ID={{custom_param1}}; having _ is mandatory in the parameter name
    • Click the Save button and you will see the following screen which contains your custom API URL. You need to pass the data in body as x-www-form-url-encoded or JSON format.
    • WordPress custom SQL query-Delete method
    • You can test the API by clicking on the Test button and fill the value for the parameters
    • WordPress custom SQL query-Delete method
    • Click on Continue to see the test results. 1 inTest Result means data has been successfully added to the database.
    • WordPress custom SQL query-Delete method

      Congratulations, you have successfully configured the Custom API for WordPress to write a custom SQL Query to DELETE the data in the WordPress database!



    miniorange img   Custom Query Parameter

    • Parameters can help you create more dynamic and customizable reports. With parameters, you can pass data information in the API URL to the query and make your query response much more responsive. Use the following syntax to name the parameter: {{paramter_name}} _ is mandatory in parameter name.

    miniorange img   Advanced Settings

    • In the Advanced Settings section, you can set a Custom Response after successful execution of the API and also choose the response type.
    • You can also restrict the access to the APIs based on the WordPress role of the user.
    • WordPress custom SQL query-Advance setting

    miniorange img  Request a demo of the plugin


    Get Full-featured Trial



     Thank you for your response. We will get back to you soon.

    Something went wrong. Please submit your query again

    Write WordPress Custom SQL Query

    Need Help?

    Mail us on apisupport@xecurify.com for quick guidance(via email/meeting) on your requirement and our team will help you to select the best suitable solution/plan as per your requirement.

    Hello there!

    Need Help? We are right here!

    support
    Contact miniOrange Support
    success

    Thanks for your inquiry.

    If you dont hear from us within 24 hours, please feel free to send a follow up email to info@xecurify.com