Re: PHP and MySQL SELECT COUNT (*)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I meant key in the array that was returned by MySQL.  I answered you in
my other post.  The array was numerically index based instead of column
based.

Thank you,
Micah Gersten
onShore Networks
Internal Developer
http://www.onshore.com



Vinny Gullotta wrote:
> If by key you mean the column in the database, it's called: servername
>
> "Micah Gersten" <micah@xxxxxxxxxxx> wrote in message
> news:48D16738.7040504@xxxxxxxxxxxxxx
>> 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@xxxxxxxxxxx> wrote in message
>>> news:48D1629D.3040801@xxxxxxxxxxxxxx
>>>> 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@xxxxxxxxxxx> wrote in message
>>>>> news:48D15B41.8010208@xxxxxxxxxxxxxx
>>>>>> 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
>>>>>>>
>>>>>
>>>>>
>>>
>>>
>
>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux