where_not_in (Solved)

sl3dg3hamm3r - I tend to agree with you, and write all my SQL queries 'in the raw'. But it's not just down to whether you're going to stick with MySQL forever (it's quite possible I'll shuffle over to postgres one day, or maybe maria (though that'll likely be 100% compatible for the queries I've written)) ... as I gather there are some security benefits. Sure you can write your own sql_clean functions, but my understanding is you simply don't have to worry about such things once you move to CI-AR.

[quote author="Maglok" date="1250860571"]After some experiments and some talking to a CI expert I know I got it. Turns out there is not a lot on the forum about where_not_in().[/quote]

And there's even less in the wiki.

Now, as much as I think our wiki needs a major overhaul (on any wiki I've set up for customers, I've always carried with me a short length of 3x2, just to emphasise the importance of never having a page called 'miscellaneous' or 'stuff' (etc)). Once you've got that in your wiki/CMS, you're doomed.

Ahem. Anyhoo .. wondering if you'd like to work out a good place to copy this post into the wiki? If you don't, let me know and I'll have a go (I've been meaning to dive into the wiki again - the last couple of times I've looked at it, my nose has started to bleed).

The thing that strikes me as odd with where_not_in() is that it wants 2 parameters of which the 2nd is an array of options. It's just a bit inconsistent with the rest of the active record class. So I had to strip a result set of the 'subquery' and put that in an array and THEN use the array as the 2nd parameter. It's a hassle, but it is still in the active record class.

Never worked with the wiki, so go ahead.

*hands tissue for that nosebleed*

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.