Quantcast
Channel: DataTables 1.10 — DataTables forums
Viewing all articles
Browse latest Browse all 2364

Another where & and question

$
0
0

Hi. I need the following sql select:

SELECT * FROM tm_tiere WHERE Geloescht=0 AND Schutzgebuehr=0 AND (Adoptant!=0 OR Vermitteltdatum!=0000-00-00

When I use

->where( function ( $q ) {
    
        $q ->where( 'tm_tiere.Schutzgebuehr', '0', '=');
        $q ->where( 'tm_tiere.Geloescht',' 0', '=');
        
        $q ->where( 'tm_tiere.Adoptant', '0', '!=' );
        $q ->or_where( 'tm_tiere.Vermitteltdatum', '0000-00-00', '!=');
        
    } )

The OR select is working but the Schutzgebuehr=0 don't work.

With

->where( function ( $q ) {
    
        $q ->where( 'tm_tiere.Schutzgebuehr', '0', '=');
        $q ->where( 'tm_tiere.Geloescht',' 0', '=');
        
        //$q ->where( 'tm_tiere.Adoptant', '0', '!=' );
        //$q ->or_where( 'tm_tiere.Vermitteltdatum', '0000-00-00', '!=');
        
    } )

it shows me the entrys with Schutzgebuehr=0 AND Geloescht=0

How can I make my needed select?

Regards

Rappt


Viewing all articles
Browse latest Browse all 2364

Trending Articles