CodeCharge Studio
search Register Login  

Visual Web Reporting

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

YesSoftware Forums -> CodeCharge Studio -> Tips & Solutions

 Function to know number of affected records or rows (PHP example)

Print topic Send  topic

Author Message

Posts: 591
Posted: 03/21/2011, 11:01 AM

We are often interested to know how many records the query affected or updated when you use direct DB operation. The function affected_rows() will return the number of rows or records affected by any update, insert or delete query.

For example, if you UPDATE some table you can use following code:
$dbr = new clsDBmydatabaseDB();    
$rate = 1.5;  
$SQLr = "update ProductPrice set ProductPriceRate=" . $rate . " where ProductPriceCurrency='USD'" ;    
$num = $dbr->affected_rows() ; //  $num contains number of affected records  

View profile  Send private message

Posts: 131
Posted: 03/21/2011, 6:43 PM

Great Tip..

Thanks Gena
:-) :-)
John Real - More CodeCharge Studio Support at -
Real Web Development At:
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

Internet Database

Visually create Web enabled database applications in minutes.

Home   |    Search   |    Members   |    Register   |    Login

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