This topic is locked

updating a count when record is loaded on the view page

7/9/2016 12:41:17 PM
PHPRunner General questions
L
lcslouis author

I am trying to update a count on when a record is loaded.
The column that the count is in is called [Scan Count].
This project has only 2 pages List and View.
The View Page is where I am trying to do this the logic is (current Scan Count)+1 .
Data on the project is added from another program.
How can I accomplish this?
I am using MS SQL for my database.

romaldus 7/11/2016



I am trying to update a count on when a record is loaded.
The column that the count is in is called [Scan Count].
This project has only 2 pages List and View.
The View Page is where I am trying to do this the logic is (current Scan Count)+1 .
Data on the project is added from another program.
How can I accomplish this?
I am using MS SQL for my database.


in view page Before Display event:

$sql = " UPDATE your_table_name SET scan_count = scan_count + 1 WHERE id = ".$values["id"]." ";

CustomQuery($sql);


  • replace your_table_name with your actual table name
  • replace id in ".$values["id"]." with actual primary key field in your table