How can I do this if statement?

How can I do this if statement?

misteammisteam Posts: 47Questions: 16Answers: 0

How can I do this if statement?

From this:

if(source = 'Email',attachments = '',attachments > 0)

In to this:

$q->where( 'is_deleted', '0', '=' );

Answers

  • misteammisteam Posts: 47Questions: 16Answers: 0

    Hi Sir @allan, I hope you could help me. Thanks in advanced

  • allanallan Posts: 54,886Questions: 1Answers: 8,602 Site admin

    I don't quite understand your question, but do you mean this?:

    $q->where('attachments', '0', '>')
    

    I don't know where your initialise line of code is from or what source or attachments is. I'd probably need more context to understand your request.

    Allan

  • misteammisteam Posts: 47Questions: 16Answers: 0

    I'm using if statement sir

    if(source = 'Email',attachments = '',attachments > 0)

    If (source = 'Email') {
    attachments = ''
    }else{
    attachments > 0
    }

  • tangerinetangerine Posts: 3,143Questions: 27Answers: 366

    I don't really understand what you're trying to do, but I can tell you this:

    If (source = 'Email') {

    That's never going to work. You are using an assignment operator where you should have a comparison (==).

  • colincolin Posts: 12,886Questions: 0Answers: 2,198

    ... and as Allan said, please can you add more context, rather than just minimal code snippets. Please post all your code with an explanation of what you're trying to achieve,

    Colin

Sign In or Register to comment.