Enhance IDb.php, pdo.php, and mysql.db.php with deleteRowById method for improved database handling.

This commit is contained in:
stephan.kasdorf
2025-11-28 09:24:09 +01:00
parent ef6bce4002
commit e4462e9402
3 changed files with 92 additions and 21 deletions

10
core/a/mysql.db.php Normal file → Executable file
View File

@@ -169,5 +169,13 @@ abstract class Db implements IDb
return Pdo::fetchRowInArrayByWhere(self::$table['table'], $field['field'], $field['value']);
}
/**
* @desc Deletes a row from the database table by id.
* @param int $id The id of the row to delete.
* @return bool Returns true if the deletion is successful, otherwise false.
*/
public function deleteRowById(int $id = 0): bool
{
Pdo::deleteRowById( self::getTable()['table'], $id );
}
}