所以我有两个MySQL表
“users”表包含id,listing_name和location
“wp_postmeta”表包含id,meta_key和meta_value
我想将“wp_postmeta”中的meta_value插入“users”表中的location列,其中ID的匹配和meta_key的值都是“address”
具有以下值的示例。
users TABLE
-----------
id: 1
listing_name: my listing
location: NULL
id: 2
listing_name: my listing 2
location: NULL
wp_postmeta TABLE
-----------
id: 1
meta_key: address
location: 12 Coding Avenue
id: 2
meta_key:address
location: 20 Python Drive
所以之后我的表应该是这样的:
users TABLE
-----------
id: 1
listing_name: my listing
location: 12 Coding Avenue
id: 2
listing_name: my listing 2
location: 20 Python Drive
wp_postmeta TABLE
-----------
id: 1
meta_key: address
location: 12 Coding Avenue
id: 2
meta_key:address
location: 20 Python Drive
我希望这是足够的信息。