PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Sunday, January 30, 2022

[FIXED] Yii condition <IS NULL>

 January 30, 2022     activerecord, conditional-statements, criteria, php, yii     No comments   

Issue

How to find row by column with null value?

It doesn't work:

$criteria->condition = '`seller_id` IS NULL';

Solution

$criteria->addCondition('seller_id IS NULL');
$data= MODEL::model()->find($criteria);

tried this? **seller_id** is the mapped column name in Yii, it may not be same as the actual column name in your database.



Answered By - Winfred
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing