1<?php
2// 1st Method - Declaring $wpdb as global and using it to execute an SQL query statement that returns a PHP object
3global $wpdb;
4$results = $wpdb->get_results( "SELECT * FROM {$wpdb->prefix}options WHERE option_id = 1", OBJECT );
5
1<?php
2
3if ( ! defined('ABSPATH') ) {
4 /** Set up WordPress environment */
5 require_once( dirname( __FILE__ ) . '/wp-load.php' );
6}
7
8global $wpdb;
9$results = $wpdb->get_results( "SELECT * FROM table_bame", OBJECT );
10
11print_r($results);