Re: [PHP] PHP and MySQL SELECT COUNT (*)

2008-09-17 Thread Jochem Maas
Dan Joseph schreef: On Wed, Sep 17, 2008 at 2:17 PM, Vinny Gullotta <[EMAIL PROTECTED]>wrote: ... $i[servername] Try: $i['servername'] notice the ' and ' around the name. I've heard you can do w/o those, but I've had issues in the past where it didn't work. ITs also good practice to us

Re: [PHP] PHP and MySQL SELECT COUNT (*)

2008-09-17 Thread Vinny Gullotta
That was it!!! Thank you all so much for your help!!! =D ""Dan Joseph"" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] On Wed, Sep 17, 2008 at 4:30 PM, Vinny Gullotta <[EMAIL PROTECTED]>wrote: If by key you mean the column in the database, it's called: servername "Micah Gerste

Re: [PHP] PHP and MySQL SELECT COUNT (*)

2008-09-17 Thread Micah Gersten
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

Re: [PHP] PHP and MySQL SELECT COUNT (*)

2008-09-17 Thread Dan Joseph
On Wed, Sep 17, 2008 at 4:30 PM, Vinny Gullotta <[EMAIL PROTECTED]>wrote: > If by key you mean the column in the database, it's called: servername > > "Micah Gersten" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > What is the key for the server name? That's what you need when

Re: [PHP] PHP and MySQL SELECT COUNT (*)

2008-09-17 Thread Micah Gersten
That's your problem, you need to use mysql_fetch_assoc instead of mysql_fetch_row. Thank you, Micah Gersten onShore Networks Internal Developer http://www.onshore.com Vinny Gullotta wrote: > var_dump looks like this: > > array(2) { [0]=> string(9) "wehost006" [1]=> string(2) "72" } array(2) > {

Re: [PHP] PHP and MySQL SELECT COUNT (*)

2008-09-17 Thread Vinny Gullotta
If by key you mean the column in the database, it's called: servername "Micah Gersten" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] 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://

Re: [PHP] PHP and MySQL SELECT COUNT (*)

2008-09-17 Thread Vinny Gullotta
var_dump looks like this: array(2) { [0]=> string(9) "wehost006" [1]=> string(2) "72" } array(2) { [0]=> string(8) "H7848-49" [1]=> string(2) "71" } array(2) { [0]=> string(7) "H7853-2" [1]=> string(2) "70" } array(2) { [0]=> string(7) "H7842-2" [1]=> string(2) "64" } array(2) { [0]=> string(9

Re: [PHP] PHP and MySQL SELECT COUNT (*)

2008-09-17 Thread Dan Joseph
On Wed, Sep 17, 2008 at 4:21 PM, Vinny Gullotta <[EMAIL PROTECTED]>wrote: > var_dump($i); looks messy, but I can see the server names in there and they > are the correct names. > > > "Micah Gersten" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > Do var_dump($i) in the loop to s

Re: [PHP] PHP and MySQL SELECT COUNT (*)

2008-09-17 Thread Micah Gersten
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. > > > "

Re: [PHP] PHP and MySQL SELECT COUNT (*)

2008-09-17 Thread Vinny Gullotta
var_dump($i); looks messy, but I can see the server names in there and they are the correct names. "Micah Gersten" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] Do var_dump($i) in the loop to see if you're getting the data you want. Thank you, Micah Gersten onShore Networks Int

Re: [PHP] PHP and MySQL SELECT COUNT (*)

2008-09-17 Thread Vinny Gullotta
""Dan Joseph"" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] On Wed, Sep 17, 2008 at 2:17 PM, Vinny Gullotta <[EMAIL PROTECTED]>wrote: What I want to do is find the top 10 servers where the column steps = iisreset. The following code works great except that the page is not displa

Re: [PHP] PHP and MySQL SELECT COUNT (*)

2008-09-17 Thread Micah Gersten
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" <[EMAIL PROTECT

Re: [PHP] PHP and MySQL SELECT COUNT (*)

2008-09-17 Thread Dan Joseph
On Wed, Sep 17, 2008 at 2:17 PM, Vinny Gullotta <[EMAIL PROTECTED]>wrote: > What I want to do is find the top 10 servers where the column steps = > iisreset. The following code works great except that the page is not > displaying the servername in the 'Server Name' column of my results (nothing >

Re: [PHP] PHP and MySQL SELECT COUNT (*)

2008-09-17 Thread Vinny Gullotta
Still no luck displaying the stupid servername. Any other things I can try? "Micah Gersten" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] You'll want to change your Order By statement to 'ORDER BY CountSteps DESC'. Thank you, Micah Gersten onShore Networks Internal Developer ht

Re: [PHP] PHP and MySQL SELECT COUNT (*)

2008-09-17 Thread Micah Gersten
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 = 'IIS

Re: [PHP] PHP and MySQL SELECT COUNT (*)

2008-09-17 Thread Vinny Gullotta
""Dan Joseph"" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] On Wed, Sep 17, 2008 at 2:30 PM, Vinny Gullotta <[EMAIL PROTECTED]>wrote: ""Dan Joseph"" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] On Wed, Sep 17, 2008 at 2:17 PM, Vinny Gullotta <[EMAIL PROTECTED]

Re: [PHP] PHP and MySQL SELECT COUNT (*)

2008-09-17 Thread Dan Joseph
On Wed, Sep 17, 2008 at 2:30 PM, Vinny Gullotta <[EMAIL PROTECTED]>wrote: > ""Dan Joseph"" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > On Wed, Sep 17, 2008 at 2:17 PM, Vinny Gullotta <[EMAIL PROTECTED] >> >wrote: >> >> What I want to do is find the top 10 servers where the

Re: [PHP] PHP and MySQL SELECT COUNT (*)

2008-09-17 Thread Vinny Gullotta
""Dan Joseph"" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] On Wed, Sep 17, 2008 at 2:17 PM, Vinny Gullotta <[EMAIL PROTECTED]>wrote: What I want to do is find the top 10 servers where the column steps = iisreset. The following code works great except that the page is not displa

Re: [PHP] PHP and MySQL SELECT COUNT (*)

2008-09-17 Thread Dan Joseph
On Wed, Sep 17, 2008 at 2:17 PM, Vinny Gullotta <[EMAIL PROTECTED]>wrote: > What I want to do is find the top 10 servers where the column steps = > iisreset. The following code works great except that the page is not > displaying the servername in the 'Server Name' column of my results (nothing >

[PHP] PHP and MySQL SELECT COUNT (*)

2008-09-17 Thread Vinny Gullotta
What I want to do is find the top 10 servers where the column steps = iisreset. The following code works great except that the page is not displaying the servername in the 'Server Name' column of my results (nothing appears, the column is just blank). servername and steps are the important col