Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I made a function in Wordpress, which should update one field status to 0. But no changes are made to the database. I don't know what is the reason. Can someone please help. I tried looking into wordpress own wp-db.php, and seen that the same array is going there as well.

        function updateData($temp_array){
            global $wpdb;
            $temp_array = array('status', '0');
            echo $wpdb->update( 'wp_testing_options', $temp_array, array( 'id' => 1 ) );
        }
share|improve this question
add comment

1 Answer

up vote 0 down vote accepted

this:

$temp_array = array('status', '0');

should be

$temp_array = array('status' => '0');
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.