Welcome Guest, Not a member yet? Register   Sign In
Checking if delete operation was successful
#5

(01-16-2023, 12:40 AM)InsiteFX Wrote:
Code:
$sqlite = new SQLite3('database.sqlite');
$statement = $sqlite->prepare('DELETE FROM mytable WHERE myclause');
$statement->execute();
echo $sqlite->changes();

Count The Number Of Rows Modified
Hi, thanks, looks like it should work, although in my case it will bypass the model hooks so I will go with repeated find for now... I did not notice any disclaimer regarding different behaviour of $db->rowsAffected() when using SQLite3 db, so I should probably report is as a bug.

I will see if I should open something like https://github.com/codeigniter4/CodeIgni...ssues/4632 with SQLite3 specifics.
==

Donatas G.
Reply


Messages In This Thread
RE: Checking if delete operation was successful - by dgvirtual - 01-16-2023, 05:40 AM



Theme © iAndrew 2016 - Forum software by © MyBB