Simple Join WHERE

Simple Join WHERE

magentoplaymagentoplay Posts: 7Questions: 3Answers: 0

I using on my hosting the example:
Editor-1.3.3/examples/simple/join.html

And in my column LOCATION, I only want show the result "London", "New York" and "Paris"
I try to put some scripts from the forum on the file join.php, but didn´t work.

->where ($key='table2.location', $value = 'London' OR 'New York' OR 'Paris')

Please any suggestion?

Answers

  • allanallan Posts: 61,822Questions: 1Answers: 10,127 Site admin

    There isn't actually a way to apply an OR query like that in the current release of the Editor libraries.

    However, there will be in 1.4, and I have implemented that already. I would be happy to send you a copy if you are interested. What you would do is use a closure which allows direct access to the query Editor is making, and therefore the use of the database where methods:

    ->where( function ( $q ) {
      $q
        ->or_where( 'table2.location', 'London' )
        ->or_where( 'table2.location', 'New York' )
        ->or_where( 'table2.location', 'Paris' );
    } )
    

    If you would like me to send over a copy of the in development libraries (they are quite stable since the majority of the work for 1.4 is not happening in these libraries!) then just let me know and if I should use the e-mail address for your account or a different one.

    Allan

  • magentoplaymagentoplay Posts: 7Questions: 3Answers: 0

    It´s working!
    I write the Allan code in my join.php
    after the code:

    $data = Editor::inst($db, 'table2.location')

    Thanks so much!

This discussion has been closed.