Quantcast
Channel: Topic Tag: MySQL | WordPress.org
Viewing all articles
Browse latest Browse all 5527

valuser on "MSQL Copy multiple fields from one table to another"

$
0
0

Have succeeded in copying one field from one table to another - see code below

I could just repeat the code for each field (3,4,6,8 etc) i want to copy BUT

if anybody knows and would be so kind to share a more elegant way (if it exists) i would be thrilled!

$check = $wpdb->get_var("SELECT value FROM $xprofile_table  WHERE user_id = $user_id AND field_id = 2 ");
$wpdb->insert( wp_bp_xprofile_data, array( 'field_id' => '2', 'user_id' => $user_id,'value' => $check, 'last_updated' => current_time( 'mysql' ) ));

Thanks


Viewing all articles
Browse latest Browse all 5527

Trending Articles