Re: [phpOpenTracker-User] How to call POT more than once in a single document?

Jean-Christian Imbeault <[email protected]>
Newsgroups gmane.comp.web.phpopentracker.general
Message-ID <[email protected]>
Florian Dittmer wrote:
> 
> I would like to call PHPOpenTracker more than once in every of my
> documents.

Good question. I tried a simple test case and it fails also but with a
more interesting error message (I'm using postgresql for a DB) :)

<?php
include 'phpOpenTracker.php';
phpOpenTracker::log(array('document' => '1'));
phpOpenTracker::log(array('document' => '2'));
?>

phpOpenTracker Error: ERROR: Cannot insert a duplicate key into unique
index pot_visitors_pkey

I fixed that with a tweak to the database. The above code now works
*but* doesn't log each page separately. Calling log twice will cause two
page impressions to be logged, but only the first call gets logged as a
document ... the second call to log '2' as a document is discarded ...

After turning debugging on I see the following:

- Only one call to insert into pot_documents is made.

- two calls to insert into pot_accesslog are made, each call inserts the
same information in pot_accesslog whereas we would think that it should
insert a different document id:

INSERT INTO pot_accesslog
(accesslog_id, timestamp, document_id,  entry_document)
VALUES (881546856, 1059524694, -2082672713, '1')

INSERT INTO pot_accesslog
(accesslog_id, timestamp, document_id,  entry_document)
VALUES (881546856, 1059524694, -2082672713, '1')

We'll have to ask Sebastian how to make multiple calls to log() and have
it log a different document :) (It might not be possible)

Sebastian?

Jean-Christian Imbeault



-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.