Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/67.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Wordpress MySQL:将字段从表(commentmeta和comments)复制到新表_Mysql_Wordpress - Fatal编程技术网

Wordpress MySQL:将字段从表(commentmeta和comments)复制到新表

Wordpress MySQL:将字段从表(commentmeta和comments)复制到新表,mysql,wordpress,Mysql,Wordpress,背景: USE wp_database; INSERT into wp_combined (country, city, continent, comment_post_id, user_id) /* note above are the only fields required to copy) */ SELECT country, city, continent, comment_post_id, user_id FROM wp_co

背景:

USE wp_database;
INSERT into wp_combined (country, city, continent, comment_post_id, user_id)     
                        /* note above are the only fields required to copy) */
SELECT country, city, continent, comment_post_id, user_id FROM wp_commentmeta, wp_comments
  • 表wp_commentmeta包含以下列:国家、城市、大陆和注释id
  • 表wp_comments包含以下列:comment_ID、comment_post_ID和user_ID
  • 我自定义创建了一个名为wp_的表,其中包含以下列:国家、城市、大陆和用户id
我想将国家、城市、大陆、用户id和评论post id复制到新创建的表wp_中。这需要将国家、城市和大陆的wp_commentmeta字段与wp_comments中的用户id和comment_post_id相关联

到目前为止我的代码:

USE wp_database;
INSERT into wp_combined (country, city, continent, comment_post_id, user_id)     
                        /* note above are the only fields required to copy) */
SELECT country, city, continent, comment_post_id, user_id FROM wp_commentmeta, wp_comments
我该怎么做?谢谢你们,朋友们