• Greetings everyone,

    basically I have a designed a custom plugin with custom tables. The tables are set properly, but I am having an issue with UPDATE query.

    That table structure has this structure:
    rater_id mediumint(9) NOT NULL ,

    ratee_id mediumint(9) NOT NULL ,
    					  rating_title VARCHAR( 90 ) NOT NULL ,
    					  rating_details_owner VARCHAR( 900 ) NOT NULL ,
    					  rating_details_worker VARCHAR( 900 ) NOT NULL ,
    					  rating_date_time DATETIME NOT NULL ,
    					  rating_date_time_gmt DATETIME NOT NULL ,

    I can use the plugin to create ratings fine. Question comes when I try to update a row using the method at http://codex.wordpress.org/Function_Reference/wpdb_Class#UPDATE_rows It doesn’t update if I specify more than than one column!

    Any idea?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Can you post the code you’re using with $wpdb?

    Thread Starter Ishimwe

    (@ishimwe)

    HI rjmastey,

    thanks for considering helping. Here’s the code:

    global $wpdb;
    $user_rating = $_POST['user_rating'];
    $feedback_date_time = current_time('mysql');
    $feedback_date_time_gmt = get_gmt_from_date($feedback_date_time);
    $table_name = $wpdb->prefix . "bids";
    $rows_affected = $wpdb->update( '$table_name',
    array( 'rating_date_time' => feedback_date_time,
    'rating_date_time_gmt' => $feedback_date_time_gmt,
    'rating_value'=> $user_rating),
    array( 'job_id' =>$job_id , 'bid_awarded'=>'awarded' ),
    array( '%s', '%s', '%s' )  );
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Updating a custom table SET issue’ is closed to new replies.