Support » Plugins » Hacks » $wpdb->insert,$wpdb->update and $wpdb->select are using a fixed column variable

  • Resolved Kakoma


    Run into something very strange while developing a plugin. $wpdb->insert (and the rest of the family) are using a fixed value for a variable that PHP is passing to them.

    $wpdb->insert( $table_name, array( 'user_id' => $user_id, 'first_name' => $first_name  ));


    echo $user_id." | ".$wpdb->last_query;


    100003685270940 | INSERT INTO 'wp_table_name'(user_id,first_name) VALUES ('2147483647','Dave')

    Notice that the $user_id printed by PHP and passed to the insert method is different from the one used by the method.
    I’ve cleared the cache($wpdb->flush()) and also done a cache reload. What’s causing this? I have no caching plugins enabled

Viewing 1 replies (of 1 total)
  • Was developing the application using Facebook’s OpenGraph API; logged in as a different user and the issue disappeared.

Viewing 1 replies (of 1 total)
  • The topic ‘$wpdb->insert,$wpdb->update and $wpdb->select are using a fixed column variable’ is closed to new replies.