How to put the array into a single variable.
Mysql looks like the below.. how can I capture the single result into a single variable..
I tried $results[total] and $results[0] but neither worked for me..
I want it to look like $mycount = 88 or something similar.
$results = $wpdb->get_results('SELECT COUNT(*) FROM wp_realty_listingsdb WHERE DOM = 0');
print "<pre>";
print "Total DOM 0 = ";
print_r($results);
print "</pre>";
(
[0] => stdClass Object
(
[COUNT(*)] => 88
)
)
Subject
Written By
Posted
How to put the array into a single variable.
September 11, 2016 04:13AM
September 11, 2016 01:21PM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.