也许有不同的方法UPDATE:
(1)
<?php
define(\'WP_USE_THEMES\', false);
require( dirname( __FILE__ ) . \'/wp-blog-header.php\' );
global $wpdb;
$matches = array(\'meta_key\' => \'user_token\');
$data = array(\'meta_value\' => \'100\');
$wpdb->update( "$wpdb->usermeta", $data, $matches);
?>
(2)
<?php
define(\'WP_USE_THEMES\', false);
require( dirname( __FILE__ ) . \'/wp-blog-header.php\' );
global $wpdb;
$multi=array(\'34\',\'55\');
Foreach ($multi as $each){
$result = $wpdb->query( $wpdb->prepare( "UPDATE $wpdb->postmeta SET meta_value = \'111\' WHERE post_id = \'$each\'", "blahblah" ) ); var_dump($result);
//OR update_post_meta($each, \'meta_key_NAME\', \'YOUR_VALUE\' );
}
?>