Asf_Db_AbstractQueryBuilder::wheres


Description

public object wheres(array $cols(string $columns => mixed $value) = array())

Parameters

cols

参数是键值对, 数据库字段名称 => 字段的值

当参数是空数组时, 函数不会做任何处理

Return Values

操作成功返回 Object, 失败返回 false

Examples

Example #1

<?php
use Asf\Db\QueryBuilder\Select;

$select = new Select();
$select->cols()
    ->from('test')
    ->wheres(array('d' => 1, 'g' => 'hhh'))
    ->orderBy('id');

// string(92) "[SQL] SELECT * FROM `test` WHERE `d` = ? AND `g` = ? ORDER BY `id` DESC [BVALUES] 1 , hhh"
var_dump($select->show());