sql db query db_select条件

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sql db query db_select条件相关的知识,希望对你有一定的参考价值。





CONDITIONS
/**********************************************************************/
->condition($field, $value = NULL,$operator = NULL)
$field The field to check or the result of a logic operation (or, and, xor)
$value The value to test against.
$operator Default: ‘=’ or ‘IN’.
Supported: =, <, >, >=, <=, IN,NOT IN, LIKE, BETWEEN, ISNULL, IS NOT NULL
return The called query object.


/**********************************************************************/


->where($snippet, $args = array())
$snippet Where clause (with placeholders)
$args Assoc array of placeholders and placeholder values.


/**********************************************************************/


->db_or()->condition()->condition() return 
Condition of OR-ed conditions.


/**********************************************************************/


->db_and()->condition()->condition()
return Condition of AND-ed conditions.


/**********************************************************************/


->isNull($field)
->isNotNull($field)
$field The field to check.
return The called query object.


/**********************************************************************/


->exists(SelectQueryInterface $select);
->notExists(SelectQueryInterface $select);
$select The query to check.
return The called query object.
/**********************************************************************/


以上是关于sql db query db_select条件的主要内容,如果未能解决你的问题,请参考以下文章

Drupal 7上的db_select() - 字段问题

Drupal 7 - 不区分大小写的 LIKE 与 db_select

MySQL 到 Drupal 7 db_select

如何在 db_select drupal 7 中使用最近记录的连接

PHP sql查询没有返回任何内容

php sql 中WHERE 的条件:IN(3,2,5,8) 结果如何按IN中的顺序排序