我对下面的$wpdb->更新有问题。var\\u dump数据正确,但更新没有将数据保存到表的记录中。表名为wp\\u rdp\\u media\\u organizations。唯一字段是media\\u org\\u id。
你们有人知道我做错了什么吗?提前谢谢。
if(isset($_POST[\'update_media_org\'])){
//var_dump($_POST);
extract($_POST);
$media_org_id = \'\';
$wpdb->update(
$wpdb->prefix.\'rdp_media_organisations\',
array(
\'media_org_id\' => $media_org_id,
\'company_name\' => $company_name,
\'gender\' => $gender,
\'first_name\' => $first_name,
\'last_name\' => $last_name,
\'street_address\' => $street_address,
\'zipcode\' => $zipcode,
\'visit_addres\' => $visit_addres,
\'visit_zipcode\' => $visit_zipcode,
\'city\' => $city,
\'country\' => $country,
\'email_address\' => $email_address,
\'telephone\' => $telephone,
\'mobile_nr\' => $mobile_nr,
\'status\' => $status,
\'comments\' => $comments,
\'last_updated\' => date("Y-m-d H:i:s")
),
array( \'media_org_id\' => $row_id ),
array(
\'%d\' ,
\'%s\' ,
\'%s\' ,
\'%s\' ,
\'%s\' ,
\'%s\' ,
\'%s\' ,
\'%s\' ,
\'%s\' ,
\'%s\' ,
\'%s\' ,
\'%s\' ,
\'%s\' ,
\'%s\' ,
\'%d\' ,
\'%s\' ,
\'%s\'
) ,
array( \'%d\' )
);
$msg = \'Record is updated sucessfully.\';
}
array(17) { ["row_id"]=> string(2) "45" ["company_name"]=> string(22) "Media Bureau Lekker bv" ["gender"]=> string(4) "Male" ["first_name"]=> string(3) "Jan" ["last_name"]=> string(8) "de Vries" ["street_address"]=> string(12) "Postadres 12" ["zipcode"]=> string(6) "8923FG" ["visit_addres"]=> string(13) "Bezoekadres 4" ["visit_zipcode"]=> string(6) "8999DW" ["city"]=> string(10) "Lekkerveen" ["country"]=> string(9) "Nederland" ["email_address"]=> string(20) "[email protected]" ["telephone"]=> string(12) "435635464536" ["mobile_nr"]=> string(14) "33634565463456" ["status"]=> string(1) "0" ["comments"]=> string(74) "Nieuw beureau oppassen met credit geven. Betalen binnen 5 dagen is vereist" ["update_media_org"]=> string(10) "Update Now" }