How to run database Query on WordPress?

devquora
devquora

Posted On: Feb 22, 2018

 

WordPress’s query function allows you to execute any SQL query on the WordPress database. It is best used when there is a need for specific, custom, or otherwise complex SQL queries. For more basic queries, such as selecting information from a table, see the other wpdb functions above such as get_results, get_var, get_row or get_col.
Syntax

<?php $wpdb->query('query'); ?> 

Read more from https://codex.wordpress.org/Class_Reference/wpdb#Running_General_Queries

    Related Questions

    Please Login or Register to leave a response.

    Related Questions

    Wordpress Interview Questions

    What is WordPress?

    WordPress is free open source content management system (CMS) written PHP language and licensed under GPL. It allows us..

    Wordpress Interview Questions

    What are minimum requirements to run WordPress?

    PHP 7 or greater MySQL 5.6 or greater OR MariaDB 10.0 or greater The mod_rewrite Apache module HTTPS support(Recommende..