query("select parent_id,id from ecminvoiceoutolds where register_date>'2010-01-01' and deleted='0'"); while($r=$GLOBALS[db]->fetchByAssoc($w)){ $rr=$GLOBALS[db]->fetchByAssoc($GLOBALS[db]->query("select * from accounts where id='".$r['parent_id']."'")); echo "update ecminvoiceoutolds set parent_address_street='".$rr['billing_address_street']."',parent_address_city='".$rr['billing_address_city']."',parent_address_postalcode='".$rr['billing_address_postalcode']."',parent_address_country='".$rr['billing_address_country']."' where id='".$r['id']."';
"; } ?>