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 " ";"; ( [0] => stdClass Object ( [COUNT(*)] => 88 ) ) __________________________________________________ ____ Relax: instrumental ringtones, country music ringtones, message tones |
Change the query like this :
$results = $wpdb->get_results('SELECT COUNT(*) as mycount FROM wp_realty_listingsdb WHERE DOM = 0'); Capture result : $mycount = $results[0]['mycount']; |
we dont know code from university
|
Nice..Thank you for sharing this information!!
|
All times are GMT -7. The time now is 04:36 AM. |
Powered by vBulletin Copyright © 2020 vBulletin Solutions, Inc.