Go Back   Site Owners Forums - Webmaster Forums > Web Programming > Programming General > PHP / mySQL

Notices


 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
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

 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to generate traffic for a single static webpage? Ruby707 Search Engine Optimization 7 09-02-2015 02:30 AM
ASP Array Question mjvndhsb ASP 1 05-15-2014 03:27 AM
Not allowing duplicate values to an array mjvndhsb Javascript 3 03-11-2014 12:40 AM


All times are GMT -7. The time now is 12:45 PM.


Powered by vBulletin Copyright © 2020 vBulletin Solutions, Inc.