How can I do this if statement?

How can I do this if statement?

misteammisteam Posts: 48Questions: 17Answers: 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: 48Questions: 17Answers: 0

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

  • allanallan Posts: 61,431Questions: 1Answers: 10,048 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: 48Questions: 17Answers: 0

    I'm using if statement sir

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

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

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

    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: 15,112Questions: 1Answers: 2,583

    ... 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.