This topic is locked

Contatore field of readings.

11/19/2006 3:31:19 AM
PHPRunner General questions
M
maxcolo author

Sorry for my english,

How I can make in order to make so that a field of a every record

increments time that a visitor the read?

Best regard

Max

J
Jane 11/20/2006

Max,
you can do it using events.

Proceed to the Events tab, select View page: OnLoad event and add your code in it.

Here is a sample code:

function ViewOnLoad()

{

global $where,$conn;

$str = "update TableName set FieldName=now() where ".$where;

db_exec($str,$conn);

}



where FieldName is your actual field name.

M
maxcolo author 11/20/2006

Tanks for your attention

Max

M
maxcolo author 11/25/2006

Fact but the contatore in the database passes from zero to 2006 and

then it remains firm. Why it does not increase of one the readings of the page?

Infinite thanks

M
maxcolo author 11/27/2006

Fact but the contatore in the database passes from zero to 2006 and

then it remains firm. Why it does not increase of one the readings of the page?

Infinite thanks


Solved

function ViewOnLoad()

{

global $where,$conn;

$str = "update curricula set statocurr=statocurr+1 where ".$where;

db_exec($str,$conn);

}