无法使用NOT EQUAL
在里面$wpdb->update()
. 下面查看的源代码update
方法-
public function update( $table, $data, $where, $format = null, $where_format = null ) {
if ( ! is_array( $data ) || ! is_array( $where ) ) {
return false;
}
$data = $this->process_fields( $table, $data, $format );
if ( false === $data ) {
return false;
}
$where = $this->process_fields( $table, $where, $where_format );
if ( false === $where ) {
return false;
}
$fields = $conditions = $values = array();
foreach ( $data as $field => $value ) {
if ( is_null( $value[\'value\'] ) ) {
$fields[] = "`$field` = NULL";
continue;
}
$fields[] = "`$field` = " . $value[\'format\'];
$values[] = $value[\'value\'];
}
foreach ( $where as $field => $value ) {
if ( is_null( $value[\'value\'] ) ) {
$conditions[] = "`$field` IS NULL";
continue;
}
$conditions[] = "`$field` = " . $value[\'format\'];
$values[] = $value[\'value\'];
}
$fields = implode( \', \', $fields );
$conditions = implode( \' AND \', $conditions );
$sql = "UPDATE `$table` SET $fields WHERE $conditions";
$this->check_current_query = false;
return $this->query( $this->prepare( $sql, $values ) );
}
NOT EQUAL
尚未处理。因此,不可能使用
NOT EQUAL
在…上
$wpdb->update()
方法