WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] $wpdb->insert,$wpdb->update and $wpdb->select are using a fixed column variable (2 posts)

  1. Kakoma
    Member
    Posted 2 years ago #

    Hi,
    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  ));

    Then:

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

    Returns:

    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

  2. Kakoma
    Member
    Posted 2 years ago #

    Was developing the application using Facebook's OpenGraph API; logged in as a different user and the issue disappeared.

Topic Closed

This topic has been closed to new replies.

About this Topic