$suc = $wpdb->update(table_name, array( 'column1' => 'value1', // string 'column2' => 'value2' // integer (number) ), array( 'ID' => 1 ), array( '%s', // value1 '%d' // value2 ), array( '%d' ) ); if( $suc === false ) { //Do something about fail } else if( $suc === 0 ){ //Do something about nothing update }
參考網址:
$wpdb - what does it return on fail?
沒有留言:
張貼留言