• Resolved andywt

    (@andywt)


    I am struggling trying to determine why the $wpdb->update is not working. here is my code:

    if($findresolved->field_name == "Resolved")
    		{
    			echo "<pre>"; var_dump( $findresolved ); echo "</pre>";
    
    			$wpdb->update( 'fg_cf7dbplugin_submits',
    				array( 'field_value' => $resolved ),
    				array( 'submit_time' => $submittime, 'field_name' => "Resolved" ),
    				array( '%s'  ),
    				array( '%s', '%s'  )
    				);
    
    			echo "field name - ", ($findresolved->field_name), "<br>";
    			echo "field value - ", ($findresolved->field_value), "<br>";
    			echo "$ resolved - ", $resolved, "<br>";
    			echo "submit_time - ", ($findresolved->submit_time), "<br>";
    			echo "$ submittime - ", $submittime, "<br>";

    I have verified that I have the correct object selected and that the variables have their values set. Here is the dump of my debug:

    object(stdClass)#474 (6) {
      ["submit_time"]=>
      string(15) "1432864680.3919"
      ["form_name"]=>
      string(31) "2015 Flag Database Missing Flag"
      ["field_name"]=>
      string(8) "Resolved"
      ["field_value"]=>
      string(2) "No"
      ["field_order"]=>
      string(2) "11"
      ["file"]=>
      NULL
    }
    field name - Resolved
    field value - No
    $ resolved -Yessir
    submit_time - 1432864680.3919
    $ submittime - 1432864680.3919

    Any ideas?

Viewing 1 replies (of 1 total)
  • Thread Starter andywt

    (@andywt)

    Solved this by accessing the $wpdb directly.

Viewing 1 replies (of 1 total)

The topic ‘$wpdb->update not updating database’ is closed to new replies.