![]() |
UPDATE being performed after INSERT, bug? - 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: UPDATE being performed after INSERT, bug? (/showthread.php?tid=51043) |
UPDATE being performed after INSERT, bug? - El Forum - 04-18-2012 [eluser]M52 Studios[/eluser] Hello everyone! I have the strangest problem that I haven't ran across before. I even separated what was once in the single "engine" function into three separate once, but still to no avail. Basically, I have to mark instances as deleted in the database before inserting new ones. But what the code in fact does, is INSERTS first, and only then UPDATES, which marks the new insertions as deleted. I am able to see this in the database, as I have created timestamped and then I timestamp the deletion, as well, and they are usually one millisecond apart. Has anyone seen this before? This has been breaking my head for about 4 hours now. I've tried caching the query, starting and ending transaction, but nothing worked. It still inserts first, even though it's clear that insertion is after updating in the code. Code: public function engine($id, $post) Thank you in advance for your help!!! EDIT: grammatical errors UPDATE being performed after INSERT, bug? - El Forum - 04-18-2012 [eluser]M52 Studios[/eluser] Something else that is interesting: When I'm running profiler, the insertion doesn't even appear in the Queries list, even though it is clearly happening in the database... |