Connecting Tech Pros Worldwide Help | Site Map

here's how I solved it

NotGiven
Guest
 
Posts: n/a
#1: Jul 17 '05
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', 'useridentification',
'yourpassword') or die(mysql_error());
mysql_select_db('databaseName', $conn);
$query = "INSERT INTO databaseTable VALUES ('".$pageVar."',
'".$seconds."')";
$result = mysql_query($query, $conn);
}


Jedi121
Guest
 
Posts: n/a
#2: Jul 17 '05

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', 'useridentification',
> 'yourpassword') or die(mysql_error());
> mysql_select_db('databaseName', $conn);
> $query = "INSERT INTO databaseTable VALUES ('".$pageVar."',
> '".$seconds."')";
> $result = mysql_query($query, $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".


Closed Thread