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

In my controller I do
PHP Code:
$meetingsModel->delete(55);
$no $meetingsModel->db->affectedRows();
echo 
$no
or, alternatively:
PHP Code:
$db db_connect();
$meetingsModel->delete(55);
$no $db->affectedRows();
echo 
$no
The script always outputs 1, both when the row 55 existed and was deleted and when it did not exist (and so was not deleted, and no rows were actually affected).
I am using SQLite3 database.
1. Is this a bug?
2. What other method could I use to check if the deletion was successful? I can only think of making another query to check if row 55 is still in the database table...
==

Donatas G.
Reply


Messages In This Thread
Checking if delete operation was successful - by dgvirtual - 01-15-2023, 11:44 AM



Theme © iAndrew 2016 - Forum software by © MyBB