0

I am using symfony1.4 and doctrine. I need to check a condition where the value is NULL. I nedd to write a query where status = 1 and start=NULL and end= NULL and estimated_time != NULL .I have tried with this but i am not able to get the result.

            $tickets = Doctrine_Core::getTable('table')
              ->createQuery('a')
              ->where('status=?','1')
              ->andWhere('start=?', '')
                              ->andWhere('end=?', '')
              ->andWhere('estimated_time!=?','')
              ->orderBy('id DESC');

any help will be greatly appreciated.Thank You..

1 Answer 1

1

Try using IS NOT NULL:

$tickets = Doctrine_Core::getTable('table')
    ->createQuery('a')
    ->where('status=?','1')
    ->andWhere('start IS NOT NULL')
    ->andWhere('end IS NOT NULL')
    ->andWhere('estimated_time IS NOT NULL')
    ->orderBy('id DESC');
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.