使用多个where子句更新wordpress数据库表

Ris*_*abh 1 mysql wordpress

我试图用多个where子句更新一行数据库,但它不起作用.这是我的代码......

$wpdb->update( 
'wp_cf_form_entry_values', 
array( 
    'value' => 'example',   // string       
), 
array( 'entry_id' => '$entryid' AND 'slug' => 'code' ), 
array( 
    '%s',   // value1       
), 
array( '%d', '%s' ) 
);
Run Code Online (Sandbox Code Playgroud)

Ris*_*abh 7

好的,我早些时候得到了我的解 所以现在我将它发布给未来的观众.问题出在第6行.

第6行

array( 'entry_id' => '$entryid' AND 'slug' => 'code' ), 
Run Code Online (Sandbox Code Playgroud)

我在第6行进行了以下更改......

array( 'entry_id' => $entryid, 'slug' => 'registration'), 
Run Code Online (Sandbox Code Playgroud)

现在我的整个更新查询与2 where子句如下所示..

$wpdb->update( 
 'wp_cf_form_entry_values', 
  array( 
    'value' => $regcode  //entering data in value field
  ), 
  array( 'entry_id' => $entryid, 'slug' => 'registration'), //two where  clause
array( 
    '%s'     //specifying which type of value entering in table
  ), 
array('%d', '%s' ) //specifying which type of value using in where cluase
Run Code Online (Sandbox Code Playgroud)

);

我也很奇怪,即使两天后我也没有从这里得到一个简单问题的答案.这只是一个简单的更新查询,没有人知道或他们不想回复...