CodeCharge Studio
search Register Login  

Visual Web Reporting

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

YesSoftware Forums -> CodeCharge Studio -> PHP

 a quick fix please.

Print topic Send  topic

Author Message
computerman


Posts: 27
Posted: 01/14/2010, 6:42 PM

$SQL = "select client_ID, total from accountinfo";
$db = new clsdbconnection1;
$db->query($SQL);
while($db->next_record())
{
$aaa = "insert into client_history (client_ID, balance) values (".$db->f("client_ID").", ".$db->f("total").")";
$db->query($aaa);
}
It only inserts first record :-<
what to make/change so array will go till end and process all results.?
any help greatly appreciated!
_________________
"whoever is a cruel, must be an old downtrod who has got authority,
whoever is a downtrod, must be an old cruel who has lost authority. "
An Oriental Saying
View profile  Send private message
Gena

Posts: 591
Posted: 01/14/2010, 11:17 PM

use different db connections for each query:

like

  
$db = new clsdbconnection1;   
$db2 = new clsdbconnection1;   
  
$SQL = "select client_ID, total from accountinfo";  
$db->query($SQL);  
while($db->next_record())  
{  
    $aaa = "insert into client_history (client_ID, balance) values (".$db->f("client_ID").", ".$db->f("total").")";  
    $db2->query($aaa);  
}  

_________________
Gena
View profile  Send private message
Gena

Posts: 591
Posted: 01/15/2010, 12:58 AM

and don't forget CLOSE() both at the end...
_________________
Gena
View profile  Send private message
computerman


Posts: 27
Posted: 01/15/2010, 4:02 AM

Quote Gena:
and don't forget CLOSE() both at the end...

you are great!
thank you so much!

I owe you $$ ;-)
_________________
"whoever is a cruel, must be an old downtrod who has got authority,
whoever is a downtrod, must be an old cruel who has lost authority. "
An Oriental Saying
View profile  Send private message
Gena

Posts: 591
Posted: 01/15/2010, 4:06 AM

thanks!

just look at my signature below O:)

_________________
Gena
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.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


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