Where condition inside if statement in editor

Where condition inside if statement in editor

SarbastSarbast Posts: 85Questions: 0Answers: 0

Hello,

I want to put where condition inside if statement, but it doesn't work. I try to break the chain like this

$editor = new Editor( ... )
->fields( ... );

if($aktiv == '1'){
$editor->where( 'tm_pflegestellen.Aktiv', $aktiv, '=')
}

$editor->process( $_POST );
$editor->json();

also got error in ->fields line.

So how to put Where condition inside if statement in editor and thanks

Replies

  • tangerinetangerine Posts: 3,342Questions: 35Answers: 394

    What is the error?

  • SarbastSarbast Posts: 85Questions: 0Answers: 0

    in if statement, it says syntax error

  • colincolin Posts: 15,112Questions: 1Answers: 2,583

    There are a few examples on this page that should get you going. Also, look at the controllers/compoundKey.php file in the download package, there are a few where clauses in there too.

    Colin

Sign In or Register to comment.