Php Wordpress错误:无法更新数据库中的帖子
你好,好的开发者 我试图在wordpress中更新帖子,但它不允许我更新帖子 我试过-Php Wordpress错误:无法更新数据库中的帖子,php,mysql,wordpress,Php,Mysql,Wordpress,你好,好的开发者 我试图在wordpress中更新帖子,但它不允许我更新帖子 我试过-wp\u update\u post和$wpdb->update,但两者都不允许我更新帖子 这是我使用的代码 $my_post = array( 'ID' => $found_post_id, 'post_type' => utf8_encode( $line_data['post_type'] ), 'post_nam
wp\u update\u post
和$wpdb->update
,但两者都不允许我更新帖子
这是我使用的代码
$my_post = array(
'ID' => $found_post_id,
'post_type' => utf8_encode( $line_data['post_type'] ),
'post_name' => utf8_encode( $line_data['post_name'] ),
'post_title' => utf8_encode( $line_data['post_title'] ),
'post_content' => utf8_encode( 'tada' ),
'post_status' => 'publish',
);
$status = wp_update_post($my_post, true);
echo "<pre>";print_r($status);
$table = $wpdb->prefix . 'posts';
$status = $wpdb->update( $table, $my_post, array( 'ID' => $found_post_id ));
echo "<pre>";print_r($status);die;
我将数据库克隆到了一个新的数据库,以检查是否存在不同字符集的问题,但这也没有解决我的问题。
我不明白我做错了什么
WP_Error Object
(
[errors] => Array
(
[db_update_error] => Array
(
[0] => Could not update post in the database
)
)
[error_data] => Array
(
)
)