CodeIgniter Forums
Query builder documentation needs warning about using replace() function - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Development (https://forum.codeigniter.com/forumdisplay.php?fid=6)
+--- Forum: CodeIgniter 3.x (https://forum.codeigniter.com/forumdisplay.php?fid=17)
+--- Thread: Query builder documentation needs warning about using replace() function (/showthread.php?tid=1439)



Query builder documentation needs warning about using replace() function - matbeard - 03-10-2015

Okay, so I know it's simple if you think about it, but sometimes people miss the obvious (I certainly did).

If you use the replace() function in Query Builder, the record is first deleted: this means if you have any foreign key constraints setup, with the cascade on delete option, all your related records are going to be deleted too.

A little warning about this may help.