run sql query from wordpress code example
Example 1: wordpress execute query
global $wpdb;
$result = $wpdb->get_results( "SELECT * FROM wp_usermeta WHERE meta_key = 'points' AND user_id = '1'");
print_r($result);
Example 2: How to run database Query in WordPress?
$wpdb->query("select * from $wpdb->posts where ID>10 ");