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

(07-02-2015, 01:51 AM)Narf Wrote: 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().

Yes exactly, 4 lines vs 1 line... not a big deal.  My poorly worded question was intended to be more about what the documentation is supposed to say.  Thank-you for the fix and clarification.
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
RE: MySQLi delete in multiply tables - by sparky672 - 07-02-2015, 11:11 AM



Theme © iAndrew 2016 - Forum software by © MyBB