Welcome Guest, Not a member yet? Register   Sign In
[2.1.1] Active Record quotes marks issues
#1

[eluser]Nom4d3[/eluser]
I tried a lot of ways and I couldn't find a way to make my 'WHERE' clauses work properly.

My testing code:
Code:
$this->db->select("table1.*")
         ->where("table1.t1_id = table2.t1_id")
         ->where("table1.t1_id", "table2.t1_id")
         ->where("table1.t1_id !=", "table2.t1_id")
         ->where("table1.t1_id", "table2.t1_id", FALSE);
$query = $this->db->get("table1, table2");
echo $this->db->last_query();

Result:
Code:
SELECT "table1".*
FROM "table1", "table2"
WHERE "table1"."t1_id" "= table2"."t1_id"
AND "table1"."t1_id" =  'table2.t1_id'
AND "table1"."t1_id" "!=" 'table2.t1_id'
AND table1.t1_id = table2.t1_id
As you can see, the 'equal' sign is receiving quotes marks

in 2.1.0 the result was
Code:
SELECT "table1".*
FROM "table1", "table2"
WHERE "table1"."t1_id" = table2.t1_id
AND "table1"."t1_id" =  'table2.t1_id'
AND "table1"."t1_id" != 'table2.t1_id'
AND table1.t1_id = table2.t1_id

The first 'where' is the one which I've been using since I began to work with CI. I don't really want to set FALSE for escape parameter for EVERY single 'where' clause I have.

Am I doing something wrong? Tested only on Postgres.


Messages In This Thread
[2.1.1] Active Record quotes marks issues - by El Forum - 06-13-2012, 06:20 AM
[2.1.1] Active Record quotes marks issues - by El Forum - 06-13-2012, 06:53 AM
[2.1.1] Active Record quotes marks issues - by El Forum - 06-13-2012, 12:32 PM
[2.1.1] Active Record quotes marks issues - by El Forum - 06-13-2012, 12:39 PM
[2.1.1] Active Record quotes marks issues - by El Forum - 06-13-2012, 01:28 PM
[2.1.1] Active Record quotes marks issues - by El Forum - 06-13-2012, 01:47 PM
[2.1.1] Active Record quotes marks issues - by El Forum - 06-13-2012, 01:56 PM
[2.1.1] Active Record quotes marks issues - by El Forum - 06-13-2012, 02:32 PM
[2.1.1] Active Record quotes marks issues - by El Forum - 06-13-2012, 04:45 PM
[2.1.1] Active Record quotes marks issues - by El Forum - 06-13-2012, 05:03 PM
[2.1.1] Active Record quotes marks issues - by El Forum - 06-13-2012, 10:03 PM
[2.1.1] Active Record quotes marks issues - by El Forum - 06-14-2012, 05:35 AM
[2.1.1] Active Record quotes marks issues - by El Forum - 06-14-2012, 06:06 AM
[2.1.1] Active Record quotes marks issues - by El Forum - 06-14-2012, 07:02 AM
[2.1.1] Active Record quotes marks issues - by El Forum - 06-14-2012, 07:14 AM
[2.1.1] Active Record quotes marks issues - by El Forum - 06-14-2012, 04:29 PM



Theme © iAndrew 2016 - Forum software by © MyBB