mysql - Update wordpress database table with multiple where clauses -


i trying update 1 row of database multiple clause not working. here code...

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

ok got solution earlier. posting future viewers. problem in 6th line.

6th line

array( 'entry_id' => '$entryid' , 'slug' => 'code' ),  

i make below changes in 6th line...

array( 'entry_id' => $entryid, 'slug' => 'registration'),  

now whole update query 2 clause looks below ..

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

);

i wonder after 2 days why didn't answer of simple question here. simple update query , no 1 knows or didn't want reply...


Comments

Popular posts from this blog

Ansible - ERROR! the field 'hosts' is required but was not set -

customize file_field button ruby on rails -

SoapUI on windows 10 - high DPI/4K scaling issue -