Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

To much escaping in where #691

Closed
nowackipawel opened this issue Aug 26, 2017 · 1 comment
Closed

To much escaping in where #691

nowackipawel opened this issue Aug 26, 2017 · 1 comment

Comments

@nowackipawel
Copy link
Contributor

nowackipawel commented Aug 26, 2017

    public function getSthByDomainId($domain_id) {
        $this->[WITH or WITHOUT builder() HERE]->select('sth_id')
            ->where('sth1_sth_id', "(SELECT `aaa_bbb_id` FROM `t_abc` WHERE `aaa_id` = " . $this->db->escapeString($domain_id) .")", FALSE)
            ->get()
            ->getResult();
        d($this->db->getLastQuery());

produces escaped query instead of FALSE passing as a third parameter of ->where method.

SELECT sth_idFROMt_sth_sthWHERE sth1_sth_id = '\(SELECTaaa_bbb_idFROMt_abcWHEREaaa_id \= 1\)'


Edit after a minute:
OK everything is ok when as second parameter we will pass NULL as is in docs, but anyway will be more useful if we would be able to pass field name as first parameter, subquery as second and false as third.

@lonnieezell
Copy link
Member

I can see how that might be useful in this particular case, but causes issues with other cases, I believe. And this is the way that CI has been since the beginning I believe. Glad you got it working, though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants