Title: $wpdb-&gt;insert,$wpdb-&gt;update and $wpdb-&gt;select are using a fixed column variable
Last modified: August 20, 2016

---

# $wpdb->insert,$wpdb->update and $wpdb->select are using a fixed column variable

 *  Resolved [Kakoma](https://wordpress.org/support/users/kakomap/)
 * (@kakomap)
 * [14 years, 1 month ago](https://wordpress.org/support/topic/wpdb-insertwpdb-update-and-wpdb-select-are-using-a-fixed-column-variable/)
 * 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

Viewing 1 replies (of 1 total)

 *  Thread Starter [Kakoma](https://wordpress.org/support/users/kakomap/)
 * (@kakomap)
 * [14 years, 1 month ago](https://wordpress.org/support/topic/wpdb-insertwpdb-update-and-wpdb-select-are-using-a-fixed-column-variable/#post-2725375)
 * 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.

## Tags

 * [$wpdb-&gt;update](https://wordpress.org/support/topic-tag/wpdb-gtupdate/)
 * [columns](https://wordpress.org/support/topic-tag/columns/)
 * [sql](https://wordpress.org/support/topic-tag/sql/)
 * [wpdb](https://wordpress.org/support/topic-tag/wpdb/)

 * In: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
 * 1 reply
 * 1 participant
 * Last reply from: [Kakoma](https://wordpress.org/support/users/kakomap/)
 * Last activity: [14 years, 1 month ago](https://wordpress.org/support/topic/wpdb-insertwpdb-update-and-wpdb-select-are-using-a-fixed-column-variable/#post-2725375)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
