“WordPress WPDB” Code-Antworten

WordPress WPDB

<?php
// 1st Method - Declaring $wpdb as global and using it to execute an SQL query statement that returns a PHP object
global $wpdb;
$results = $wpdb->get_results( "SELECT * FROM {$wpdb->prefix}options WHERE option_id = 1", OBJECT );
Open Otter

WordPress WPDB

<?php

if ( ! defined('ABSPATH') ) {
    /** Set up WordPress environment */
    require_once( dirname( __FILE__ ) . '/wp-load.php' );
}

global $wpdb;
$results = $wpdb->get_results( "SELECT * FROM table_bame", OBJECT );

print_r($results);
Matteoweb

Ähnliche Antworten wie “WordPress WPDB”

Fragen ähnlich wie “WordPress WPDB”

Durchsuchen Sie beliebte Code-Antworten nach Sprache

Durchsuchen Sie andere Codesprachen