$test = $link->prepare('DELETE FROM tbl_admin_postcodes'); // $link is a valid connection
$test->execute();
echo "Affected rows: " . $test->rowCount(); // returns 0 though rows are removed
It returns a valid PDOStatement, and I can pull data on selects and so forth, however INSERTs and DELETEs all return 0 if I call rowCount().
Anyone worked with PDO SQLite before? Ever found this?
I'm kinda lost for words. If I want to use SQLite3 then I have to use PDO ... and PDO implementation is broken. That'd be a FANTASTIC thing to have in the PHP documentation so a person could read it BEFORE they went off and wrote a stack of code for it.
It probably doesn't matter that much, but I always like to build that into my abstraction so that I can easily check that actions have had the desired effect.
I just went back and had a tinker, and yeah ... I cant get affected rows from anything. exec() and query() expose no extra info.