or_where condition in php

or_where condition in php

orik3ll0orik3ll0 Posts: 36Questions: 12Answers: 2
edited April 2017 in Free community support

Hello all.

Here is my SQL where date > '$todaydate1' or (date > '$yesterday' and time >= '$time') and I need to write it in editor. How it should work? I took code from forums and it is not working even without or.

    ->where( function ( $q ) {
        $q
            ->where( 'date', $todaydate1, '=' )
            ->or_where( function ( $r ) {
                $r->where( 'date', $yesterday);
                $r->where( 'time', $time, '>=' );
            } );
    } )

Answers

This discussion has been closed.