need php/mysql help

Discussion in 'PHP' started by sunnyverma1984, Apr 27, 2011.

  1. #1
    i have create php script which logs each visit in mysql database

    i want to generate graph for user activiti in past 24 hours like
    [​IMG]

    how to do this please help :confused:
     
    sunnyverma1984, Apr 27, 2011 IP
  2. TimK

    TimK Peon

    Messages:
    51
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    You need the help of a GD library to accomplish this, just customize this code to suit your needs.

    http://valokuva.org/?p=60
     
    TimK, Apr 27, 2011 IP
  3. jestep

    jestep Prominent Member

    Messages:
    3,659
    Likes Received:
    215
    Best Answers:
    19
    Trophy Points:
    330
    #3
    Try this script - http://pchart.sourceforge.net/

    Great tool for creating charts. You will basically need to pull the data from the database and then it is fairly easy to generate a chart with it.

    Google charts has an api that can be used for this as well which is nice since you don't need to install gd or anything else on you server - http://code.google.com/apis/chart/
     
    jestep, Apr 28, 2011 IP
  4. ap2010

    ap2010 Guest

    Messages:
    41
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Google "opensource php charts". I bet you'll find half a dozen useful scripts that you can use in your project for free.
     
    ap2010, Apr 29, 2011 IP
  5. Mak3MyDay

    Mak3MyDay Peon

    Messages:
    25
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #5
    You can use PHP and Dojo for the chart
    dojotoolkit[dot]org/documentation/tutorials/1.6/charting/
     
    Mak3MyDay, Apr 29, 2011 IP
  6. clonepal

    clonepal Active Member

    Messages:
    128
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    73
    #6
    clonepal, Apr 29, 2011 IP
  7. bojanvuk

    bojanvuk Active Member

    Messages:
    73
    Likes Received:
    1
    Best Answers:
    1
    Trophy Points:
    55
    #7
    Before trying different charting libraries decide what do you want to chart :). Make sure that you're collecting the proper data. For example from data "ip,pagevisited,time" you won't be able to make exactly the same chart as you've attached.
     
    bojanvuk, Apr 29, 2011 IP
  8. lioncub5

    lioncub5 Peon

    Messages:
    27
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #8
    logging visits in a database with php is a waste.
    all of the data you are collecting is already in your server log files.
    do your website a favor and just make the charts from the .log file.
     
    lioncub5, Apr 29, 2011 IP
  9. bojanvuk

    bojanvuk Active Member

    Messages:
    73
    Likes Received:
    1
    Best Answers:
    1
    Trophy Points:
    55
    #9
    @lioncub5
    That's right. There are many tools capable of analyzing apache logs and making great charts. However you have to get access to the logs. On a shared hosting it can be a problem.
     
    bojanvuk, Apr 30, 2011 IP