Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

wp do sql query from function

<?php
// 2nd Method - Utilizing the $GLOBALS superglobal. Does not require global keyword ( but may not be best practice )
$results = $GLOBALS['wpdb']->get_results( "SELECT * FROM {$wpdb->prefix}options WHERE option_id = 1", OBJECT );
Source by developer.wordpress.org #
 
PREVIOUS NEXT
Tagged: #wp #sql #query #function
ADD COMMENT
Topic
Name
5+7 =