sql - Mysql select user_ID and use these to construct INSERT statement, possible? -


is possible unite these 2 mysql commands?

i need user_id first sql command, used inside insert statement.

select distinct(user_id) wp_usermeta meta_key = "wp_capabilities";   insert wp_usermeta (user_id, meta_key, meta_value) values ('user_id', 'wp_s2member_auto_eot_time', 1366286009),        ('user_id', 'wp_s2member_paid_registration_times', 'a:2:{s:5:"level";s:10:"1366285409";s:6:"level1";s:10:"1366285409";}'); 

first statement return list of user_id's can rather long. i'd each of these id's insert add respective 2 rows.

i write php script same, put first list in array , , run every insert using php. i'd learn bit more sql. possible i'm trying achieve?

enter image description here

does table wp_usermeta have other columns? have primary key or other index?

(i'm sorry asking clarification in "answer", system not let me add comments other people's question - yet. add clarification, revise "answer" actual answer question.)


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -