CodeCharge Studio
search Register Login  

Web Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> Archive -> GotoCode Archive

 Increasing views field in a forum

Print topic Send  topic

Author Message
Akim
Posted: 07/29/2002, 3:56 PM

Hi, with CodechargeStudio, I have a "views" field in a forum. Each time a message is viewed, I want a the field "views" updated to "views+1". The primary key is "message_id". How do I do that ?
folkerts
Posted: 07/30/2002, 5:46 AM

In mysql with php you can do something like this in the after initialize event of the Viewmessage page.
*****************************
$message_id = CCGetParam("message_id",false);
if ($message_id){
$db = new clsDB%connectionname%;
$sql = "Update views set views=views+1 where message_id=$message_id");
$db->query($sql);
unset($db);
}
***********************************
hope it helps i think in other languages it will be some more of the same

folkerts

   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.