Re: PHP and MySQL SELECT COUNT (*)
| From: | Micah Gersten | Date: | Wed, 17 Sep 2008 20:23:20 +0000 |
| Subject: | Re: PHP and MySQL SELECT COUNT (*) | ||
| References: | 1 2 3 4 5 6 7 8 9 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-280405@lists.php.net to get a copy of this message | ||
What is the key for the server name? That's what you need when you
output it.
Thank you,
Micah Gersten
onShore Networks
Internal Developer
http://www.onshore.com
Vinny Gullotta wrote:
> var_dump($i); looks messy, but I can see the server names in there and
> they are the correct names.
>
>
> "Micah Gersten" <micah@onshore.com> wrote in message
> news:48D1629D.3040801@onshore.com...
>> Do var_dump($i) in the loop to see if you're getting the data you want.
>>
>> Thank you,
>> Micah Gersten
>> onShore Networks
>> Internal Developer
>> http://www.onshore.com
>>
>>
>>
>> Vinny Gullotta wrote:
>>> Still no luck displaying the stupid servername. Any other things I can
>>> try?
>>>
>>>
>>> "Micah Gersten" <micah@onshore.com> wrote in message
>>> news:48D15B41.8010208@onshore.com...
>>>> You'll want to change your Order By statement to 'ORDER BY CountSteps
>>>> DESC'.
>>>>
>>>> Thank you,
>>>> Micah Gersten
>>>> onShore Networks
>>>> Internal Developer
>>>> http://www.onshore.com
>>>>
>>>>
>>>>
>>>> Vinny Gullotta wrote:
>>>>> echo $query;
>>>>>
>>>>> yields
>>>>>
>>>>> SELECT servername, COUNT(steps) as CountSteps FROM monitoring WHERE
>>>>> steps = 'IISRESET' AND timestamp <= '2008-09-17
>>>>> 11:40:34' AND
>>>>> timestamp >= '2008-08-17' GROUP BY servername ORDER BY COUNT(*)
>>>>> DESC
>>>>> LIMIT 10
>>>>>
>>>
>>>
>
>