Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

wordpress access database php

//https://developer.wordpress.org/reference/classes/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 );
 
PREVIOUS NEXT
Tagged: #wordpress #access #database #php
ADD COMMENT
Topic
Name
1+5 =