select user_id
from ec_orders
where order_id = :order_id
insert into ec_addresses
(address_id, user_id, address_type, attn, line1, line2, city, usps_abbrev, full_state_name, zip_code, country_code, phone, phone_time)
values
(:address_id, :user_id, 'shipping', :attn, :line1, :line2, :city, :usps_abbrev, :full_state_name, :zip_code, :country_code, :phone, :phone_time)
update ec_orders
set shipping_address = :address_id
where order_id = :order_id
update ec_creditcards
set billing_address = :address_id
where creditcard_id = :creditcard_id