CodeCharge Studio
search Register Login  

Web Reports

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

YesSoftware Forums -> CodeCharge Studio -> PHP

 how to update a record?

Print topic Send  topic

Author Message
crazy rabbit
Posted: 06/05/2004, 7:48 PM

:-@

hi. i want update a record of a table when you open this page. for example, when you read on of the article of my site, the record -"article_views" will changed into "article_views+1"

thanks
carzy rabbit
Posted: 06/05/2004, 7:49 PM

sorry, it should is "when you read one of the article of my site" , its "one" not "on"
ghtracey

Posts: 23
Posted: 06/07/2004, 12:59 PM

Assuming your connection is named Connection your articles table has the field ViewCount and is indexed by ArticleID(integer), and you pass ArticleID to the page as a parameter.

in BeforeShow()

if (CCGetParam("ArticleID") <> "") {
$db = new clsDBConnection;
$db->query("UPDATE articles SET ViewCount = ViewCount + 1 WHERE ArticleID=".$db->ToSQL(CCGetParam("ArticleID),ccsInteger));
unset($db);
}

_________________
Graham Tracey
Council of Yukon First Nations
View profile  Send private message

Add new topic Subscribe to topic   


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

PHP Reports

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

Home   |    Search   |    Members   |    Register   |    Login


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