Welcome Guest, Not a member yet? Register   Sign In
Can not use Active Record for simple query?
#7

[eluser]seeraw[/eluser]
[quote author="Dennis Rasmussen" date="1299256001"][quote author="seeraw" date="1299255706"][quote author="Dennis Rasmussen" date="1299254749"][quote author="seeraw" date="1299254430"]Hi

I tested above query with my own conditions like

$this->db->select('*');
$this->db->from('TABLE_NAME');

$this->db->where('column name','value'); //condition one
$this->db->or_where('column name','value'); //condition tow
$this->db->where('column name','value'); //condition three
$this->db->or_where('column name','value'); //condition four
$this->db->get();

and it's working fine (it changes the sequence of "AND" and "OR" in your query other wise no problem with this query ),

what output you are getting with your query?

Thanks,
Swapnil[/quote]

Did you see his brackets?[/quote]


Yes but though it is complicated it will work it will not produce any error
What I mean you can also write the same query with AR[/quote]
You're not making any sense, at least not to me.
How is your code answering his problem?

@seeraw, AR is meant to be used for simple queries. You CAN do what you want with AR, but the work it requires is more complicated than just running $this->db->query();[/quote]

OK,
Sorry I didn't see "brackets"
And I agree that "AR is meant to be used for simple queries"
if it is the case with "brackets" we can write such queries with

$this->db->query("QUERY HERE");
Am I correct Dennis Rasmussen.


Messages In This Thread
Can not use Active Record for simple query? - by El Forum - 03-04-2011, 02:53 AM
Can not use Active Record for simple query? - by El Forum - 03-04-2011, 03:54 AM
Can not use Active Record for simple query? - by El Forum - 03-04-2011, 04:00 AM
Can not use Active Record for simple query? - by El Forum - 03-04-2011, 04:05 AM
Can not use Active Record for simple query? - by El Forum - 03-04-2011, 04:21 AM
Can not use Active Record for simple query? - by El Forum - 03-04-2011, 04:26 AM
Can not use Active Record for simple query? - by El Forum - 03-04-2011, 04:42 AM
Can not use Active Record for simple query? - by El Forum - 03-04-2011, 06:08 AM
Can not use Active Record for simple query? - by El Forum - 03-04-2011, 06:14 AM
Can not use Active Record for simple query? - by El Forum - 03-04-2011, 06:16 AM



Theme © iAndrew 2016 - Forum software by © MyBB