Dbal.sql in set

From phpBB Development Wiki

Revision as of 13:44, 3 November 2008 by Chiron (Talk | contribs)
(diff) ← Older revision | Current revision (diff) | Newer revision → (diff)

dbal::sql_in_set –– Builds in set string for use within an sql_query.

This article is a stub. You can help in improving Olympus Documentation by expanding it.

Contents

Description

  1. string sql_in_set ( String $column , Array $array [, Bool $negate [, Bool $allow_empty_set ]] )

Builds IN, NOT IN, = and <> sql comparison string. Defined in dbal class.

Parameters

Parameter Usage
column Name of the sql column that shall be compared.
array Array of values that are allowed (IN) or not allowed (NOT IN).
negate (Optional) true for NOT IN (), false for IN () (default).
allow_empty_set (Optional) If true, allow $array to be empty, this function will return 1=1 or 1=0 then. Default to false.

Return Values

Returns a string to be used in the WHERE clause of an SQL Query

Examples

Example #1

$sql_in = array(25862);

$sql 'SELECT *
    FROM ' 
USERS_TABLE '
    WHERE ' 
$db->sql_in_set('user_id'$sql_in);


See Also