Session->set_flashdata Doesn't Work After Database Query |
[eluser]Nalorin[/eluser]
Ok, so this is really strange: I am working on a segment of my project where the user deletes an ad that they have created. The following is the code that I have currently: Code: function delete_ad() Now, the problem is that the line indicated in the code above does not work where it's placed. However, if I place it above the foreach loop (where indicated), it works fine. The problem with the latter option is that none of the work has been done, yet, so the message would not reflect the true status of the work. The delete_record function returns TRUE on success, FALSE on failure, and 0 if an invalid table is selected (so the user cannot delete from whatever table they want by tampering with the input. I am getting a database error: Code: Error Number: 1054 Can someone please point out where I'm going wrong? Thanks!
[eluser]Nalorin[/eluser]
Hrmm... if nobody's responding, I wonder if this is a bug?
[eluser]Nalorin[/eluser]
Ok - I found the solution. It had to do with overlapping Active Record calls. See, I had a bunch of items in my database, and was deleting them while I was testing this form... and I was running out of things to delete (so I worked in favour of "pretending" to delete ads, rather than having to repopulate the database)... My code in my Ad_model looked like this: Code: function delete_record($table,$id)
[eluser]InsiteFX[/eluser]
You can also use keep_flashdata for another round! InsiteFX |
Welcome Guest, Not a member yet? Register Sign In |