Re: PHP and MySQL SELECT COUNT (*)
| From: | Vinny Gullotta | Date: | Wed, 17 Sep 2008 21:21:23 +0000 |
| Subject: | Re: PHP and MySQL SELECT COUNT (*) | ||
| References: | 1 2 3 4 5 6 7 8 9 10 11 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-280413@lists.php.net to get a copy of this message | ||
That was it!!! Thank you all so much for your help!!! =D
""Dan Joseph"" <dmjoseph@gmail.com> wrote in message news:a20394490809171333o5aad934dj2fc78326d59bccb8@mail.gmail.com...
On Wed, Sep 17, 2008 at 4:30 PM, Vinny Gullotta <vgullotta@intermedia.net>wrote:If by key you mean the column in the database, it's called: servername "Micah Gersten" <micah@onshore.com> wrote in message news:48D16738.7040504@onshore.com... What is the key for the server name? That's what you need when youThanks, I know your problem, sorry for not seeing this sooner. mysql_fetch_row returns the numerical array types. $array[0]... You want to use mysql_fetch_array(). Change to that, and you should be seeing the servername's. -- -Dan Joseph www.canishosting.com - Plans start @ $1.99/month. "Build a man a fire, and he will be warm for the rest of the day. Light a man on fire, and will be warm for the rest of his life."output it. Thank you, Micah Gersten onShore Networks Internal Developer http://www.onshore.com Vinny Gullotta wrote:-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.phpvar_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