[PHP] Re: Incrementing variables based on database data

2008-08-12 Thread Jon Drukman
Vinny Gullotta wrote: Well, what I need to be able to do is then take the numbers of each count and figure out which is used the most. We use this database to log actions taken on servers in our network. What my boss wants me to come up with is a list of which commands are issued the most, whic

Re: [PHP] Re: Incrementing variables based on database data

2008-08-12 Thread Micah Gersten
Well, MySQL can aggregate the data for you so you don't have to pass it to PHP. It can just give you the results. I suggest reading up on the SELECT COUNT syntax and the GROUP BY syntax in MySQL. Thank you, Micah Gersten onShore Networks Internal Developer http://www.onshore.com Vinny Gullott

Re: [PHP] Re: Incrementing variables based on database data

2008-08-12 Thread Vinny Gullotta
Well, what I need to be able to do is then take the numbers of each count and figure out which is used the most. We use this database to log actions taken on servers in our network. What my boss wants me to come up with is a list of which commands are issued the most, which servers get the most

Re: [PHP] Re: Incrementing variables based on database data

2008-08-12 Thread Micah Gersten
Why not let the DB do this for you? You can group by whatever column that is and select count(*), column_your_looking_for. Thank you, Micah Gersten onShore Networks Internal Developer http://www.onshore.com Vinny Gullotta wrote: > Nevermind, I figured it out. I needed to make the if statements

[PHP] Re: Incrementing variables based on database data

2008-08-12 Thread Vinny Gullotta
Nevermind, I figured it out. I needed to make the if statements use == instead of = like this: if ($i[4] == "IISRESET") { $iiscount = $iiscount + 1; } etc. =) ""Vinny Gullotta"" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] below is the output I'm seeing along with my code. The