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?
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
Post a Comment