Forum Replies Created

Viewing 1 replies (of 1 total)
  • Forum: Hacks
    In reply to: Update Query
    Thread Starter ShadyAce

    (@shadyace)

    Oh I found the solution, apparently I wasn’t too far away.
    My where clause was faulty,
    I have now changed my code as follows:

    global $wpdb;
            $foobarOptie = $_POST["foobar"];
            $deleteOptie = $_POST["DeleteData"];
            $table = "wp_cool_plugin_options";
            $data_array = array('idOptions' => 1, 'isFoobar' => $foobarOptie, 'DeleteData' => $deleteOptie);
            $where = array('idOptions' => 1);
            $wpdb->update( $table, $data_array, $where );

    And now it works like a charm 🙂

Viewing 1 replies (of 1 total)