CodeIgniter Forums
Unexpected NULL returned in AR delete() - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Unexpected NULL returned in AR delete() (/showthread.php?tid=7318)



Unexpected NULL returned in AR delete() - El Forum - 04-03-2008

[eluser]barbazul[/eluser]
I think this is more a documentation issue that an actual bug, but, when you call the active record method delete() passing an array of tables the return value is NULL which doesn't say much about how well it worked.
I can see why it doesn't make a lot of sense to return TRUE if all went well or FALSE in case one failed because there is nothing you can do about it at that point but at least there should be some documentation about this.

IMHO the best approach would be to always return TRUE and make a note in the documentation mentioning this special case.

BTW, there is a typo in the docs:

An array of table names can be passed into delete() if you would like to delete data from more then 1 table.

More info