How to update values with wpdb
-
Hey there,
for a project, I added a new row to the wp_users table called ‘buildings’. Using wpdb, I want to update the values of this row. Maybe I’m dumb, maybe it was just a hard day, but I can’t get my code working:
$table = 'wp_users'; $data = 'agdweft'; // My head on the keyboard, told you it was a hard day :D $where = 'buildings'; $wpdb->update( $table, $data, $where);
That is based on the example:
<?php $wpdb->update( $table, $data, $where, $format = null, $where_format = null ); ?>
https://codex.wordpress.org/Class_Reference/wpdb#UPDATE_rows
I’m sure the connection is working fine, reading the values does not make any problems.
What am I doing wrong?
Thanks for reading!
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘How to update values with wpdb’ is closed to new replies.