codeigniter active record sub query using where not in

Share on TwitterDigg This

using sub query in where clause in codeignitercoodeigniter subquer where not in

$this->db->where();
This function enables you to set WHERE clauses

$names = array('Frank', 'Todd', 'James');
$this->db->where_in('username', $names);
// Produces: WHERE username IN ('Frank', 'Todd', 'James')
 
$this->db->where('`store_id` NOT IN (SELECT `store_id` FROM `user_store`)', NULL, FALSE);

The ,NULL,FALSE in the where() tells CodeIgniter not to escape the query

Related

About prabin t p

Connect with me on Google+
This entry was posted in codeigniter and tagged , , . Bookmark the permalink.

3 Responses to codeigniter active record sub query using where not in

  1. Kamryn says:

    Back in school, I’m doing so much learnnig.

  2. hi!,I love your writing very so much! percentage we communicate extra about your post on AOL? I require an expert in this house to resolve my problem. May be that is you! Having a look forward to see you.

  3. Wow, wonderful blog layout! How long have you been blogging for? you make blogging look easy. The overall look of your site is great, let alone the content!. Thanks For Your article about codeigniter active record sub query using where not in | crashcoder .

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">

*