here's how I solved it

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • NotGiven

    here's how I solved it

    here's how I finally did it with help from people here and other places.
    What do you think?

    function calcElapsedTime ($pageVar, $timeVar) {
    // calculates elapsed time in seconds
    $seconds = intval((time()-$timeVar));
    // puts in that and the associated page in a database
    $conn = mysql_pconnect( 'yourhost', 'useridentifica tion',
    'yourpassword') or die(mysql_error ());
    mysql_select_db ('databaseName' , $conn);
    $query = "INSERT INTO databaseTable VALUES ('".$pageVar."' ,
    '".$seconds."') ";
    $result = mysql_query($qu ery, $conn);
    }


  • Jedi121

    #2
    Re: here's how I solved it

    "NotGiven" a écrit le 16/01/2004 :[color=blue]
    > here's how I finally did it with help from people here and other places.[/color]
    Did what?[color=blue]
    > What do you think?[/color]
    Like is it nice, efficient, etc?[color=blue]
    >
    > function calcElapsedTime ($pageVar, $timeVar) {
    > // calculates elapsed time in seconds
    > $seconds = intval((time()-$timeVar));
    > // puts in that and the associated page in a database
    > $conn = mysql_pconnect( 'yourhost', 'useridentifica tion',
    > 'yourpassword') or die(mysql_error ());
    > mysql_select_db ('databaseName' , $conn);
    > $query = "INSERT INTO databaseTable VALUES ('".$pageVar."' ,
    > '".$seconds."') ";
    > $result = mysql_query($qu ery, $conn);
    > }[/color]

    I think you should have posted in reply of your own post because there
    whitout any context it is no use. I guess you're after the "How can I
    count the number of seconds a page is viewed".


    Comment

    Working...