Unexpected database behavior
-
I have some code that increments a database field:
$result = $wpdb->query( "UPDATE test SET counter = (counter + 1) WHERE id = 1" );
Oddly, if WPPA+ is activated, the above statement increments counter by 2! If I change it to
(counter + 3)
it increments counter by 6!This code also increments counter by 2 if WPPA+ is active:
$row = $wpdb->get_row("SELECT * FROM bvweb_test WHERE id=1"); $mycount = $row->counter + 1; $status = $wpdb->update("bvweb_test", array("counter" => $mycount), array( "id" => 1));
If I deactivate WPPA+ both examples work as expected. At first I thought it was a WP issue, so I tried the mysqli functions instead of $wpdb. Same results. Checked my theme and other plugins – WPPA+ is the only one that causes this behavior.
Any thoughts/suggestions? Unfortunately this is a development site without public access, so I can’t share a link to it.
- The topic ‘Unexpected database behavior’ is closed to new replies.