问题
I can't update with wpdb->update
here is my code :
$tweet = $_POST['tweet'];
$id = $_POST['id'];
$wpdb->update( $table_name, array('id' => $id , 'tweet' => $tweet ), array( 'id' => $id ),array("%d","%s"), array("%d") );
Nothing wrong i think , but i can't update
thanks advanced
回答1:
$data_update = array('title' => $title ,'parent_id' => $parent_id);
$data_where = array('id' => $id);
$wpdb->update($table_name , $data_update, $data_where);
Simple & working ;)
来源:https://stackoverflow.com/questions/11350886/wordpress-wpdb-update-not-working