Re: [PHP] graph - dowloads/hr

2005-08-11 Thread Sebastian

Richard Lynch wrote:


On Tue, August 9, 2005 3:07 pm, Sebastian wrote:
 


i'd like to create a graph with the amount of downloads per hour, i am a
little confused how i should go about this.

i know i can use rrdtool/mrtg, but im looking for more 'user friendly'
graphs with custom colors,etc.

each time someone downloads a file it is incremented in the db and the
last time the file was downloaded. i am unsure about the data i would
need to store to create and if what i am storing is enough to do this.
any suggestions or tools that already exists to create this types of
graph?
   



select count(*) as score from downloads where date_add(download_time,
interval 1 hour) = now() group by filename order by score desc

Then you use jpgraph on that result set.

Or just roll your own with http://php.net/gd

 



Richard, the last download time is store in unix timestamp.. is it 
possible to still do it?


thanks.


--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.338 / Virus Database: 267.10.6/69 - Release Date: 8/11/2005

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



Re: [PHP] graph - dowloads/hr

2005-08-10 Thread Richard Lynch
On Tue, August 9, 2005 3:07 pm, Sebastian wrote:
 i'd like to create a graph with the amount of downloads per hour, i am a
 little confused how i should go about this.

 i know i can use rrdtool/mrtg, but im looking for more 'user friendly'
 graphs with custom colors,etc.

 each time someone downloads a file it is incremented in the db and the
 last time the file was downloaded. i am unsure about the data i would
 need to store to create and if what i am storing is enough to do this.
 any suggestions or tools that already exists to create this types of
 graph?

select count(*) as score from downloads where date_add(download_time,
interval 1 hour) = now() group by filename order by score desc

Then you use jpgraph on that result set.

Or just roll your own with http://php.net/gd

-- 
Like Music?
http://l-i-e.com/artists.htm

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



[PHP] graph - dowloads/hr

2005-08-09 Thread Sebastian
i'd like to create a graph with the amount of downloads per hour, i am a 
little confused how i should go about this.


i know i can use rrdtool/mrtg, but im looking for more 'user friendly' 
graphs with custom colors,etc.


each time someone downloads a file it is incremented in the db and the 
last time the file was downloaded. i am unsure about the data i would 
need to store to create and if what i am storing is enough to do this.  
any suggestions or tools that already exists to create this types of graph?



--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.338 / Virus Database: 267.10.4/66 - Release Date: 8/9/2005

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



Re: [PHP] graph - dowloads/hr

2005-08-09 Thread Philip Hallstrom
i'd like to create a graph with the amount of downloads per hour, i am a 
little confused how i should go about this.


i know i can use rrdtool/mrtg, but im looking for more 'user friendly' graphs 
with custom colors,etc.


each time someone downloads a file it is incremented in the db and the last 
time the file was downloaded. i am unsure about the data i would need to 
store to create and if what i am storing is enough to do this.  any 
suggestions or tools that already exists to create this types of graph?


jpgraph can do it... as can a lot of other graph/chart libraries...

http://www.aditus.nu/jpgraph/

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



Re: [PHP] graph - dowloads/hr

2005-08-09 Thread Sebastian

Philip Hallstrom wrote:

i'd like to create a graph with the amount of downloads per hour, i 
am a little confused how i should go about this.


i know i can use rrdtool/mrtg, but im looking for more 'user 
friendly' graphs with custom colors,etc.


each time someone downloads a file it is incremented in the db and 
the last time the file was downloaded. i am unsure about the data i 
would need to store to create and if what i am storing is enough to 
do this.  any suggestions or tools that already exists to create this 
types of graph?



jpgraph can do it... as can a lot of other graph/chart libraries...

http://www.aditus.nu/jpgraph/


yeah, i found that, but i dont know what type of data i would need to 
store to get the downloads an hour (24 hours).
likewise, i only increment a counter and last time file was download and 
im pretty sure this isn't enough to generate such graphs.



--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.338 / Virus Database: 267.10.4/66 - Release Date: 8/9/2005

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



Re: [PHP] graph - dowloads/hr

2005-08-09 Thread Philip Hallstrom
i'd like to create a graph with the amount of downloads per hour, i am a 
little confused how i should go about this.


i know i can use rrdtool/mrtg, but im looking for more 'user friendly' 
graphs with custom colors,etc.


each time someone downloads a file it is incremented in the db and the 
last time the file was downloaded. i am unsure about the data i would need 
to store to create and if what i am storing is enough to do this.  any 
suggestions or tools that already exists to create this types of graph?



jpgraph can do it... as can a lot of other graph/chart libraries...

http://www.aditus.nu/jpgraph/


yeah, i found that, but i dont know what type of data i would need to store 
to get the downloads an hour (24 hours).
likewise, i only increment a counter and last time file was download and im 
pretty sure this isn't enough to generate such graphs.


Ah... then in that case you need to keep a log of downloads by hour.  If I 
were you I'd create a database with a table that kept track of this stuff. 
Each row would contain the downloaded file ID, the date, the hour (set 
minutes to 00) and the number of times downloaded.


You could then query this table to get a downloads by hour graph or a 
downloads by date graph or whatever else you might want.


good luck!

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