• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
or_where problem with active record

#1
[eluser]bobbob[/eluser]
This is probably simple but I don't see it.
Code:
$pages = explode(",",$pages_string);
$this->db->select('name, text,page_number');
$this->db->where('article_id',$id);
$this->db->where('page_number',$pages[0]);
$this->db->or_where('page_number',$pages[1]);
$this->db->order_by('page_number');
$q = $this->db->get('articles');

This will write ors for all 3 conditions but as you guessed i want ors for the page numbers and AND for the article_id.
Can I do this with active record or do I need to just use $this->db->query()?


Messages In This Thread
or_where problem with active record - by El Forum - 06-20-2012, 05:11 PM
or_where problem with active record - by El Forum - 06-20-2012, 05:17 PM
or_where problem with active record - by El Forum - 06-20-2012, 05:19 PM
or_where problem with active record - by El Forum - 06-20-2012, 05:23 PM
or_where problem with active record - by El Forum - 06-20-2012, 05:40 PM
or_where problem with active record - by El Forum - 06-20-2012, 07:56 PM
or_where problem with active record - by El Forum - 06-21-2012, 01:28 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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