Welcome Guest, Not a member yet? Register   Sign In
Active Record Escaping on Column names in db->where
#1

[eluser]lookatthosemoose[/eluser]
I know consideration has been made to skip escaping strings in the db->where method with the optional 3rd parameter - escape = true/false.

for example:

... from('products,clients,inventory')->where('clients.id',"products.client_id",FALSE) ...
should produce:


Code:
... FROM (
products, clients, inventory
)
WHERE clients.id = products.client_id ...


I can only get:

Code:
... FROM (
products, clients, inventory
)
WHERE clients.id = 'products.client_id' ...


even with the 3rd parameter as FALSE. Am I doing something wrong? Thanks

--Eric--
#2

[eluser]lookatthosemoose[/eluser]
OK, I'm dumb. I need to be using db->join.

But still, I would think that passing FALSE as 3rd parameter will tell the method to NOT escape the string.
#3

[eluser]Seppo[/eluser]
I'm not sure, but I think the third parameter is to avoid the column name escaping, not the value. Why don't you just where("clients.id = products.client_id") ?




Theme © iAndrew 2016 - Forum software by © MyBB