Welcome Guest, Not a member yet? Register   Sign In
MySQLi delete in multiply tables
#18

(07-01-2015, 02:10 PM)sparky672 Wrote:
(05-20-2015, 03:20 PM)Narf Wrote: I didn't realize there was such an example in the documentation ... that may indeed make it a bug. The potential issues that you see, together with other factors (like not making it easy to delete from 10 tables by accident) are why I wouldn't consider this to be a good feature. Will have to look into it again, I guess.

What is the final determination on this?  Are the docs wrong or is this a bug?  

For the same example, deleting an `id` from multiple tables, what should the code look like instead?

I am not happy about having to commit this, but it's obviously designed to do that and it's a BC break, so ... https://github.com/bcit-ci/CodeIgniter/c...d3dc82ee58

As for how to delete the same ID from multiple tables ... assuming you're not using foreign keys with ON DELETE CASCADE, just calling delete() in a foreach loop is just fine. And no, I don't care that it would be 3-4 lines instead of 1 - it guarantees that multiple deletes is what you want, and you didn't unknowingly pass an array or the wrong WHERE condition to delete().
Reply


Messages In This Thread
MySQLi delete in multiply tables - by xmod - 05-15-2015, 08:02 AM
RE: MySQLi delete in multiply tables - by gadelat - 05-16-2015, 01:38 AM
RE: MySQLi delete in multiply tables - by xmod - 05-16-2015, 10:59 AM
RE: MySQLi delete in multiply tables - by CroNiX - 05-16-2015, 04:01 PM
RE: MySQLi delete in multiply tables - by xmod - 05-17-2015, 01:08 AM
RE: MySQLi delete in multiply tables - by gadelat - 05-17-2015, 05:25 AM
RE: MySQLi delete in multiply tables - by xmod - 05-17-2015, 05:45 AM
RE: MySQLi delete in multiply tables - by CroNiX - 05-17-2015, 09:55 AM
RE: MySQLi delete in multiply tables - by Narf - 05-18-2015, 12:47 AM
RE: MySQLi delete in multiply tables - by CroNiX - 05-18-2015, 07:39 AM
RE: MySQLi delete in multiply tables - by Athov - 05-18-2015, 07:53 AM
RE: MySQLi delete in multiply tables - by Narf - 05-20-2015, 03:20 PM
RE: MySQLi delete in multiply tables - by Narf - 07-02-2015, 01:51 AM



Theme © iAndrew 2016 - Forum software by © MyBB