Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Mar 2004
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts

    site statistics - number of clicks

    hi,

    i am stuck in a problem, kindly help.
    i am making a site, in which the visitor clicks on apply (for a credit card), now, how can i know that how many times apply for a card has been clicked by the user, i need to create a statistics that for a particular card - n number of times apply was clicked.

    Thank you,
    Gaurav

  • #2
    raf
    raf is offline
    Master Coder
    Join Date
    Jul 2002
    Posts
    6,589
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You'll need to have a login system in place, so that you can identify the user. (after login, store the users ID inside a sessionvariable)
    And then you need to increment a variable inside the table with your userdata. Like
    $sql="update usertabel set cardcounter=cardcounter+1 where userID = " . $_SESSION['uID'] ;

    But i woul create a seperate table where you insert a new record with the userID, the PHP sessionID, the date-time and all other relevant data. You can then get the count for each user by running a

    SELECT count(*) as cardcounter, userID FROM cardtransactions GROUP BY userID

    It gives you more detail and doesn't realy create any overhead since this query can be ran ofline or when trafic is low.
    Posting guidelines I use to see if I will spend time to answer your question : http://www.catb.org/~esr/faqs/smart-questions.html


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •