View Single Post
Old 12-22-2016, 09:13 PM   #1
alanwaston
Registered User
 
Join Date: Dec 2016
Posts: 5
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
)
)
__________________________________________________ ____
Relax: instrumental ringtones, country music ringtones, message tones

Last edited by alanwaston; 01-08-2017 at 09:33 PM..
alanwaston is offline   Reply With Quote